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

Method get_crdt_trunk

atomic-core/src/pristine/txn/write/mod.rs:1169–1179  ·  view source on GitHub ↗
(&self, key: &[u8; 12])

Source from the content-addressed store, hash-verified

1167
1168impl crate::pristine::traits::CrdtTxnT for WriteTxn<'_> {
1169 fn get_crdt_trunk(&self, key: &[u8; 12]) -> PristineResult<Option<SerializedTrunk>> {
1170 let table = self.txn.open_table(TRUNKS)?;
1171 let result = match table.get(key)? {
1172 Some(guard) => {
1173 let bytes_copy: Vec<u8> = guard.value().to_vec();
1174 decode_trunk_value(&bytes_copy)
1175 }
1176 None => None,
1177 };
1178 Ok(result)
1179 }
1180
1181 fn get_crdt_inode_trunk(&self, inode: u64) -> PristineResult<Option<[u8; 12]>> {
1182 let table = self.txn.open_table(INODE_TRUNK)?;

Callers

nothing calls this directly

Calls 2

decode_trunk_valueFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected