MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / operation_details

Method operation_details

atomic-repository/src/repository/operation.rs:323–352  ·  view source on GitHub ↗

Return full operation data, receipts, verification, and current head scopes.

(
        &self,
        operation_id: OperationId,
    )

Source from the content-addressed store, hash-verified

321
322 /// Return full operation data, receipts, verification, and current head scopes.
323 pub fn operation_details(
324 &self,
325 operation_id: OperationId,
326 ) -> Result<OperationDetails, RepositoryError> {
327 let txn = self.pristine.read_txn().map_err(pristine_error)?;
328 let operation = txn
329 .get_operation(operation_id)
330 .map_err(pristine_error)?
331 .ok_or_else(|| RepositoryError::OperationNotFound {
332 selector: operation_id.to_string(),
333 })?;
334 let mut receipts = txn
335 .get_effect_receipts(operation_id)
336 .map_err(pristine_error)?;
337 sort_receipts(&mut receipts);
338 let verification = operation_verification_state(&receipts);
339 let mut head_of: Vec<OperationScope> = txn
340 .list_operation_heads()
341 .map_err(pristine_error)?
342 .into_iter()
343 .filter_map(|(scope, heads)| heads.as_slice().contains(&operation_id).then_some(scope))
344 .collect();
345 head_of.sort_unstable();
346 Ok(OperationDetails {
347 operation,
348 receipts,
349 verification,
350 head_of,
351 })
352 }
353
354 /// Prepare a native remote command before its protocol mutation begins.
355 pub fn prepare_remote_operation(

Calls 10

sort_receiptsFunction · 0.85
read_txnMethod · 0.80
get_operationMethod · 0.45
get_effect_receiptsMethod · 0.45
collectMethod · 0.45
into_iterMethod · 0.45
list_operation_headsMethod · 0.45
containsMethod · 0.45
as_sliceMethod · 0.45