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

Method get_working_copy

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

Source from the content-addressed store, hash-verified

741
742impl WorkingCopyTxnT for ReadTxn {
743 fn get_working_copy(&self, id: WorkingCopyId) -> PristineResult<Option<WorkingCopyRecord>> {
744 let table = match self.txn.open_table(WORKING_COPIES) {
745 Ok(table) => table,
746 Err(redb::TableError::TableDoesNotExist(_)) => {
747 return Err(PristineError::WorkingCopySchemaUnavailable);
748 }
749 Err(error) => return Err(error.into()),
750 };
751 let result = match table.get(id.as_bytes())? {
752 Some(value) => decode_working_copy_row(id.as_bytes(), value.value()).map(Some),
753 None => Ok(None),
754 };
755 result
756 }
757
758 fn list_working_copies(&self) -> PristineResult<Vec<WorkingCopyRecord>> {
759 let table = match self.txn.open_table(WORKING_COPIES) {

Calls 4

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

Tested by 1