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

Method list_operation_heads

atomic-core/src/pristine/txn/write/operation.rs:106–131  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

104 }
105
106 fn list_operation_heads(&self) -> PristineResult<Vec<(OperationScope, OperationHeads)>> {
107 let table = match self.txn.open_table(OP_HEADS) {
108 Ok(table) => table,
109 Err(redb::TableError::TableDoesNotExist(_)) => {
110 return Err(PristineError::OperationSchemaUnavailable);
111 }
112 Err(error) => return Err(error.into()),
113 };
114 let mut rows = Vec::new();
115 for entry in table.iter()? {
116 let (key, value) = entry?;
117 let scope =
118 decode_operation_scope(key.value()).map_err(operation_serialization_error)?;
119 let heads =
120 decode_operation_heads(value.value()).map_err(operation_serialization_error)?;
121 for head in heads.as_slice() {
122 if OperationTxnT::get_operation(self, *head)?.is_none() {
123 return Err(PristineError::OperationNotFound {
124 id: head.to_string(),
125 });
126 }
127 }
128 rows.push((scope, heads));
129 }
130 Ok(rows)
131 }
132
133 fn get_effect_receipts(&self, operation: OperationId) -> PristineResult<Vec<EffectReceipt>> {
134 if OperationTxnT::get_operation(self, operation)?.is_none() {

Callers

nothing calls this directly

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