MCPcopy Create free account
hub / github.com/apache/fory / sub_slice

Method sub_slice

rust/fory-core/src/buffer.rs:549–560  ·  view source on GitHub ↗
(&self, start: usize, end: usize)

Source from the content-addressed store, hash-verified

547
548 #[inline(always)]
549 pub fn sub_slice(&self, start: usize, end: usize) -> Result<&[u8], Error> {
550 // Allow start == bf.len() when end == bf.len() to support empty slices at buffer end
551 if start > self.bf.len() || end > self.bf.len() || end < start {
552 Err(Error::buffer_out_of_bound(
553 start,
554 self.bf.len(),
555 self.bf.len(),
556 ))
557 } else {
558 Ok(&self.bf[start..end])
559 }
560 }
561
562 #[inline(always)]
563 pub fn slice_after_cursor(&self) -> &[u8] {

Callers 8

read_latin1_stringMethod · 0.80
read_utf16_stringMethod · 0.80
skip_stringFunction · 0.80
skip_decimalFunction · 0.80
read_remote_type_metaMethod · 0.80
read_latin1_standardFunction · 0.80
read_utf8_standardFunction · 0.80
read_latin1_simdFunction · 0.80

Calls 1

lenMethod · 0.80

Tested by

no test coverage detected