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

Method get_crdt_trunk

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

Source from the content-addressed store, hash-verified

1319
1320impl crate::pristine::traits::CrdtTxnT for ReadTxn {
1321 fn get_crdt_trunk(
1322 &self,
1323 key: &[u8; 12],
1324 ) -> PristineResult<Option<crate::crdt::tables::SerializedTrunk>> {
1325 use crate::crdt::tables::{decode_trunk_value, TRUNKS};
1326 let table = crdt_table_opt!(self, TRUNKS);
1327 let result = match table.get(key)? {
1328 Some(guard) => {
1329 let bytes_copy: Vec<u8> = guard.value().to_vec();
1330 decode_trunk_value(&bytes_copy)
1331 }
1332 None => None,
1333 };
1334 Ok(result)
1335 }
1336
1337 fn get_crdt_inode_trunk(&self, inode: u64) -> PristineResult<Option<[u8; 12]>> {
1338 use crate::crdt::tables::INODE_TRUNK;

Callers 4

get_file_with_optionsFunction · 0.45
update_trunk_stateFunction · 0.45
update_trunk_pathFunction · 0.45
crdt_trunk_existsFunction · 0.45

Calls 2

decode_trunk_valueFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected