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

Method iter_trunk_branches

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

Source from the content-addressed store, hash-verified

1820 }
1821
1822 fn iter_trunk_branches(
1823 &self,
1824 trunk_key: &[u8; 12],
1825 ) -> PristineResult<Box<dyn Iterator<Item = Result<[u8; 12], PristineError>> + '_>> {
1826 use crate::crdt::tables::TRUNK_BRANCHES;
1827 let table = crdt_multimap_opt!(self, TRUNK_BRANCHES, Ok(Box::new(std::iter::empty())));
1828 let mut results: Vec<Result<[u8; 12], PristineError>> = Vec::new();
1829 let values = table.get(trunk_key)?;
1830 for value_result in values {
1831 match value_result {
1832 Ok(access) => results.push(Ok(*access.value())),
1833 Err(e) => results.push(Err(PristineError::Storage(Box::new(e)))),
1834 }
1835 }
1836 Ok(Box::new(results.into_iter()))
1837 }
1838
1839 fn iter_branch_leaves(
1840 &self,

Callers 3

projection_snapshotFunction · 0.45

Calls 4

valueMethod · 0.80
getMethod · 0.65
pushMethod · 0.45
into_iterMethod · 0.45

Tested by 2

projection_snapshotFunction · 0.36