pub(crate) trait ByteSlice {
// Required methods
fn read_u64(&self) -> u64;
fn write_u64(&mut self, value: u64);
fn offset_from(&self, other: &Self) -> isize;
fn parse_digits(&self, func: impl FnMut(u8)) -> &Self;
}
🔬This is a nightly-only experimental API. (
dec2flt
)Expand description
Helper methods to process immutable bytes.
Required Methods§
Sourcefn read_u64(&self) -> u64
🔬This is a nightly-only experimental API. (dec2flt
)
fn read_u64(&self) -> u64
dec2flt
)Reads 8 bytes as a 64-bit integer in little-endian order.
Sourcefn write_u64(&mut self, value: u64)
🔬This is a nightly-only experimental API. (dec2flt
)
fn write_u64(&mut self, value: u64)
dec2flt
)Writes a 64-bit integer as 8 bytes in little-endian order.
Sourcefn offset_from(&self, other: &Self) -> isize
🔬This is a nightly-only experimental API. (dec2flt
)
fn offset_from(&self, other: &Self) -> isize
dec2flt
)Calculate the difference in length between two slices.
Sourcefn parse_digits(&self, func: impl FnMut(u8)) -> &Self
🔬This is a nightly-only experimental API. (dec2flt
)
fn parse_digits(&self, func: impl FnMut(u8)) -> &Self
dec2flt
)Iteratively parse and consume digits from bytes.
Returns the same bytes with consumed digits being elided. Breaks on invalid digits.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.