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

Function decode_working_copy_row

atomic-core/src/pristine/txn/read.rs:94–109  ·  view source on GitHub ↗
(
    key: &[u8; WorkingCopyId::SIZE],
    bytes: &[u8],
)

Source from the content-addressed store, hash-verified

92}
93
94fn decode_working_copy_row(
95 key: &[u8; WorkingCopyId::SIZE],
96 bytes: &[u8],
97) -> PristineResult<WorkingCopyRecord> {
98 let key_id = WorkingCopyId::from_bytes(*key);
99 let record = decode_working_copy_record(bytes)?;
100 if record.id != key_id {
101 return Err(PristineError::Inconsistent {
102 message: format!(
103 "WORKING_COPIES key {} contains record for {}",
104 key_id, record.id
105 ),
106 });
107 }
108 Ok(record)
109}
110
111impl ReadTxn {
112 /// Create a new read transaction

Callers 2

get_working_copyMethod · 0.70
list_working_copiesMethod · 0.70

Calls 1

Tested by

no test coverage detected