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

Method count

atomic-core/src/change/format_v3/graph_fields/decode.rs:159–166  ·  view source on GitHub ↗
(&mut self, cost: usize, available: usize)

Source from the content-addressed store, hash-verified

157 }
158 }
159 fn count(&mut self, cost: usize, available: usize) -> FormatResult<usize> {
160 let n = usize::try_from(get(&mut self.control)?).map_err(|_| invalid("count overflow"))?;
161 if n > available {
162 return Err(invalid("count exceeds available data"));
163 }
164 charge(&mut self.budget, n, cost)?;
165 Ok(n)
166 }
167 fn path(&mut self) -> FormatResult<String> {
168 let id: usize = self.n(PATH)?;
169 let path = self

Callers 3

positionsMethod · 0.45
edgesMethod · 0.45
decodeFunction · 0.45

Calls 3

getFunction · 0.70
invalidFunction · 0.70
chargeFunction · 0.70

Tested by

no test coverage detected