MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / chunk

Method chunk

src/ore/src/bytes.rs:145–153  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

143 }
144
145 fn chunk(&self) -> &[u8] {
146 // Return the first non-empty segment.
147 self.segments
148 .iter()
149 .filter(|(c, _len)| !c.is_empty())
150 .map(|(c, _len)| Buf::chunk(c))
151 .next()
152 .unwrap_or_default()
153 }
154
155 fn advance(&mut self, mut cnt: usize) {
156 assert!(cnt <= self.len, "Advance past the end of buffer");

Callers 2

test_last_segment_emptyFunction · 0.45

Calls 5

nextMethod · 0.45
mapMethod · 0.45
filterMethod · 0.45
iterMethod · 0.45
is_emptyMethod · 0.45

Tested by 2

test_last_segment_emptyFunction · 0.36