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

Method get_operation

atomic-core/src/pristine/txn/write/operation.rs:50–63  ·  view source on GitHub ↗
(&self, id: OperationId)

Source from the content-addressed store, hash-verified

48
49impl OperationTxnT for WriteTxn<'_> {
50 fn get_operation(&self, id: OperationId) -> PristineResult<Option<Operation>> {
51 let table = match self.txn.open_table(OPERATIONS) {
52 Ok(table) => table,
53 Err(redb::TableError::TableDoesNotExist(_)) => {
54 return Err(PristineError::OperationSchemaUnavailable);
55 }
56 Err(error) => return Err(error.into()),
57 };
58 let result = match table.get(id.as_bytes())? {
59 Some(value) => decode_operation_row(id.as_bytes(), value.value()).map(Some),
60 None => Ok(None),
61 };
62 result
63 }
64
65 fn list_operations(&self) -> PristineResult<Vec<Operation>> {
66 let table = match self.txn.open_table(OPERATIONS) {

Callers 1

Calls 4

valueMethod · 0.80
decode_operation_rowFunction · 0.70
getMethod · 0.65
as_bytesMethod · 0.45

Tested by

no test coverage detected