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

Method get_crdt_leaf

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

Source from the content-addressed store, hash-verified

1816 }
1817
1818 fn get_crdt_leaf(
1819 &self,
1820 key: &[u8; 12],
1821 ) -> PristineResult<Option<crate::crdt::tables::SerializedLeaf>> {
1822 use crate::crdt::tables::{decode_leaf_value, LEAVES};
1823 let table = crdt_table_opt!(self, LEAVES);
1824 let result = match table.get(key)? {
1825 Some(guard) => {
1826 let bytes: [u8; 22] = *guard.value();
1827 Some(decode_leaf_value(&bytes))
1828 }
1829 None => None,
1830 };
1831 Ok(result)
1832 }
1833
1834 fn get_trunk_by_path(&self, path: &str) -> PristineResult<Option<crate::crdt::TrunkId>> {
1835 use crate::crdt::tables::{decode_trunk_id, PATH_TRUNK};

Callers 14

get_file_lines_by_trunkFunction · 0.45
update_leaf_stateFunction · 0.45
update_leaf_contentFunction · 0.45
verify_branch_leavesMethod · 0.45
leavesFunction · 0.45
validate_tokensFunction · 0.45

Calls 3

decode_leaf_valueFunction · 0.85
getMethod · 0.65
valueMethod · 0.45

Tested by 1

projection_snapshotFunction · 0.36