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

Method get_working_copy

atomic-core/src/pristine/txn/write/working_copy.rs:29–42  ·  view source on GitHub ↗
(&self, id: WorkingCopyId)

Source from the content-addressed store, hash-verified

27
28impl WorkingCopyTxnT for WriteTxn<'_> {
29 fn get_working_copy(&self, id: WorkingCopyId) -> PristineResult<Option<WorkingCopyRecord>> {
30 let table = match self.txn.open_table(WORKING_COPIES) {
31 Ok(table) => table,
32 Err(redb::TableError::TableDoesNotExist(_)) => {
33 return Err(PristineError::WorkingCopySchemaUnavailable);
34 }
35 Err(error) => return Err(error.into()),
36 };
37 let result = match table.get(id.as_bytes())? {
38 Some(value) => decode_working_copy_row(id.as_bytes(), value.value()).map(Some),
39 None => Ok(None),
40 };
41 result
42 }
43
44 fn list_working_copies(&self) -> PristineResult<Vec<WorkingCopyRecord>> {
45 let table = match self.txn.open_table(WORKING_COPIES) {

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected