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

Method iter_trunk_branches

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

Source from the content-addressed store, hash-verified

1221 }
1222
1223 fn iter_trunk_branches(
1224 &self,
1225 trunk_key: &[u8; 12],
1226 ) -> PristineResult<Box<dyn Iterator<Item = Result<[u8; 12], PristineError>> + '_>> {
1227 use crate::crdt::tables::TRUNK_BRANCHES;
1228 let table = crdt_multimap_opt!(self, TRUNK_BRANCHES, Ok(Box::new(std::iter::empty())));
1229 let mut results: Vec<Result<[u8; 12], PristineError>> = Vec::new();
1230 let values = table.get(trunk_key)?;
1231 for value_result in values {
1232 match value_result {
1233 Ok(access) => results.push(Ok(*access.value())),
1234 Err(e) => results.push(Err(PristineError::Storage(Box::new(e)))),
1235 }
1236 }
1237 Ok(Box::new(results.into_iter()))
1238 }
1239
1240 fn iter_branch_leaves(
1241 &self,

Callers 2

Calls 3

getMethod · 0.65
pushMethod · 0.45
into_iterMethod · 0.45

Tested by 1