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

Method list_operation_heads

atomic-core/src/pristine/txn/read.rs:689–714  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

687 }
688
689 fn list_operation_heads(&self) -> PristineResult<Vec<(OperationScope, OperationHeads)>> {
690 let table = match self.txn.open_table(OP_HEADS) {
691 Ok(table) => table,
692 Err(redb::TableError::TableDoesNotExist(_)) => {
693 return Err(PristineError::OperationSchemaUnavailable);
694 }
695 Err(error) => return Err(error.into()),
696 };
697 let mut rows = Vec::new();
698 for entry in table.iter()? {
699 let (key, value) = entry?;
700 let scope =
701 decode_operation_scope(key.value()).map_err(operation_serialization_error)?;
702 let heads =
703 decode_operation_heads(value.value()).map_err(operation_serialization_error)?;
704 for head in heads.as_slice() {
705 if OperationTxnT::get_operation(self, *head)?.is_none() {
706 return Err(PristineError::OperationNotFound {
707 id: head.to_string(),
708 });
709 }
710 }
711 rows.push((scope, heads));
712 }
713 Ok(rows)
714 }
715
716 fn get_effect_receipts(&self, operation: OperationId) -> PristineResult<Vec<EffectReceipt>> {
717 if OperationTxnT::get_operation(self, operation)?.is_none() {

Callers 1

operation_detailsMethod · 0.45

Calls 7

decode_operation_scopeFunction · 0.85
decode_operation_headsFunction · 0.85
valueMethod · 0.80
is_noneMethod · 0.80
iterMethod · 0.45
as_sliceMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected