MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / next

Method next

nodedb-codec/src/fastlanes/mod.rs:243–257  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

241 type Item = Result<Vec<i64>, CodecError>;
242
243 fn next(&mut self) -> Option<Self::Item> {
244 if self.blocks_remaining == 0 {
245 return None;
246 }
247 let mut values = Vec::new();
248 match decode_block(self.data, self.offset, &mut values, self.current_block) {
249 Ok(new_offset) => {
250 self.offset = new_offset;
251 self.current_block += 1;
252 self.blocks_remaining -= 1;
253 Some(Ok(values))
254 }
255 Err(e) => Some(Err(e)),
256 }
257 }
258
259 fn size_hint(&self) -> (usize, Option<usize>) {
260 (self.blocks_remaining, Some(self.blocks_remaining))

Callers 2

decode_bytes_pipelineFunction · 0.45
block_iterator_skipFunction · 0.45

Calls 1

decode_blockFunction · 0.70

Tested by 1

block_iterator_skipFunction · 0.36