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

Method get_crdt_trunk

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

Source from the content-addressed store, hash-verified

1256
1257impl crate::pristine::traits::CrdtTxnT for ReadTxn {
1258 fn get_crdt_trunk(
1259 &self,
1260 key: &[u8; 12],
1261 ) -> PristineResult<Option<crate::crdt::tables::SerializedTrunk>> {
1262 use crate::crdt::tables::{decode_trunk_value, TRUNKS};
1263 let table = crdt_table_opt!(self, TRUNKS);
1264 let result = match table.get(key)? {
1265 Some(guard) => {
1266 let bytes_copy: Vec<u8> = guard.value().to_vec();
1267 decode_trunk_value(&bytes_copy)
1268 }
1269 None => None,
1270 };
1271 Ok(result)
1272 }
1273
1274 fn get_crdt_inode_trunk(&self, inode: u64) -> PristineResult<Option<[u8; 12]>> {
1275 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