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

Method get_crdt_trunk

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

Source from the content-addressed store, hash-verified

2285
2286impl crate::pristine::traits::CrdtTxnT for WriteTxn<'_> {
2287 fn get_crdt_trunk(&self, key: &[u8; 12]) -> PristineResult<Option<SerializedTrunk>> {
2288 let table = self.txn.open_table(TRUNKS)?;
2289 let result = match table.get(key)? {
2290 Some(guard) => {
2291 let bytes_copy: Vec<u8> = guard.value().to_vec();
2292 decode_trunk_value(&bytes_copy)
2293 }
2294 None => None,
2295 };
2296 Ok(result)
2297 }
2298
2299 fn get_crdt_inode_trunk(&self, inode: u64) -> PristineResult<Option<[u8; 12]>> {
2300 let table = self.txn.open_table(INODE_TRUNK)?;

Callers

nothing calls this directly

Calls 3

decode_trunk_valueFunction · 0.85
valueMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected