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

Method get_bytes

src/ore/src/bytes.rs:211–229  ·  view source on GitHub ↗
(&self, start: u64, length: usize)

Source from the content-addressed store, hash-verified

209 }
210
211 fn get_bytes(&self, start: u64, length: usize) -> parquet::errors::Result<Bytes> {
212 let start = usize::cast_from(start);
213 let mut buf = self.clone();
214 if start > buf.remaining() {
215 return Err(ParquetError::EOF(format!(
216 "seeking {start} bytes ahead, but only {} remaining",
217 buf.remaining()
218 )));
219 }
220 buf.advance(start);
221 if length > buf.remaining() {
222 return Err(ParquetError::EOF(format!(
223 "copying {length} bytes, but only {} remaining",
224 buf.remaining()
225 )));
226 }
227 let bytes = buf.copy_to_bytes(length);
228 Ok(bytes)
229 }
230}
231
232impl From<Bytes> for SegmentedBytes {

Callers

nothing calls this directly

Calls 4

copy_to_bytesMethod · 0.80
cloneMethod · 0.45
remainingMethod · 0.45
advanceMethod · 0.45

Tested by

no test coverage detected