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

Method id

atomic-core/src/change/format_v3/semantic/decode.rs:61–79  ·  view source on GitHub ↗
(&mut self, branch: bool)

Source from the content-addressed store, hash-verified

59 }
60 }
61 fn id(&mut self, branch: bool) -> FormatResult<(NodeId, u32)> {
62 let (input, o, i) = if branch && self.c.split_ids {
63 (
64 &mut self.c.branches,
65 &mut self.branch_owner,
66 &mut self.branch_index,
67 )
68 } else {
69 (
70 &mut self.c.leaves,
71 &mut self.leaf_owner,
72 &mut self.leaf_index,
73 )
74 };
75 Ok((
76 NodeId::new(o.read(input)?),
77 u32::try_from(i.read(input)?).map_err(|_| invalid("ID index overflow"))?,
78 ))
79 }
80 fn branch(&mut self) -> FormatResult<BranchId> {
81 let (o, i) = self.id(true)?;
82 Ok(BranchId::new(o, i))

Callers 2

branchMethod · 0.45
leafMethod · 0.45

Calls 2

invalidFunction · 0.70
readMethod · 0.45

Tested by

no test coverage detected