pub trait RequestReader: Read {
// Required methods
fn read_until(&mut self, byte: u8) -> Result<Vec<u8>>;
fn remaining_len(&self) -> usize;
// Provided methods
fn read_count(&mut self, count: usize) -> Result<Box<[u8]>> { ... }
fn read_all(&mut self) -> Result<Box<[u8]>> { ... }
fn read_type<T: IntoBytes + FromBytes + Immutable + KnownLayout>(
&mut self,
) -> Result<T> { ... }
fn string(&mut self) -> Result<LxString> { ... }
fn name(&mut self) -> Result<LxString> { ... }
}
Expand description
Helpers to parse FUSE messages.
Required Methods§
Sourcefn read_until(&mut self, byte: u8) -> Result<Vec<u8>>
fn read_until(&mut self, byte: u8) -> Result<Vec<u8>>
Read until a matching byte is found.
This should advance the read position beyond the matching byte, and return the data up to (but not including) the matching byte.
This is used to read NULL-terminated strings.
Sourcefn remaining_len(&self) -> usize
fn remaining_len(&self) -> usize
Gets the remaining, unread length of the input data.
Provided Methods§
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.