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

Method get_operation

atomic-core/src/pristine/txn/read.rs:634–646  ·  view source on GitHub ↗
(&self, id: OperationId)

Source from the content-addressed store, hash-verified

632
633impl OperationTxnT for ReadTxn {
634 fn get_operation(&self, id: OperationId) -> PristineResult<Option<Operation>> {
635 let table = match self.txn.open_table(OPERATIONS) {
636 Ok(table) => table,
637 Err(redb::TableError::TableDoesNotExist(_)) => {
638 return Err(PristineError::OperationSchemaUnavailable);
639 }
640 Err(error) => return Err(error.into()),
641 };
642 match table.get(id.as_bytes())? {
643 Some(value) => decode_operation_row(id.as_bytes(), value.value()).map(Some),
644 None => Ok(None),
645 }
646 }
647
648 fn list_operations(&self) -> PristineResult<Vec<Operation>> {
649 let table = match self.txn.open_table(OPERATIONS) {

Calls 4

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