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

Method get_crdt_trunk

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

Source from the content-addressed store, hash-verified

1688
1689impl crate::pristine::traits::CrdtTxnT for WriteTxn<'_> {
1690 fn get_crdt_trunk(&self, key: &[u8; 12]) -> PristineResult<Option<SerializedTrunk>> {
1691 let table = self.txn.open_table(TRUNKS)?;
1692 let result = match table.get(key)? {
1693 Some(guard) => {
1694 let bytes_copy: Vec<u8> = guard.value().to_vec();
1695 decode_trunk_value(&bytes_copy)
1696 }
1697 None => None,
1698 };
1699 Ok(result)
1700 }
1701
1702 fn get_crdt_inode_trunk(&self, inode: u64) -> PristineResult<Option<[u8; 12]>> {
1703 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