pub trait ParseInput: Sized {
type Data: AsRef<[u8]> + Deref<Target = [u8]> + Into<Vec<u8>>;
Show 24 methods
// Required methods
fn push_front(&mut self, data: impl Into<Vec<u8>>) -> Result<()>;
fn read(&mut self, data: &mut [u8]) -> Result<()>;
fn split_n(&mut self, n: usize) -> Result<Self>;
fn skip_n(&mut self, n: usize) -> Result<()>;
fn find_zero(&mut self) -> Result<usize>;
fn parse_n_ahead(&mut self, n: usize) -> Result<Vec<u8>>;
fn compare_ahead(&mut self, c: &[u8]) -> Result<bool>;
fn parse_all(self) -> Result<Self::Data>;
fn empty(self) -> Result<()>;
fn non_empty(self) -> Result<Option<Self>>;
// Provided methods
fn parse_chunk<const N: usize>(&mut self) -> Result<[u8; N]> { ... }
fn split_parse<T: Parse<Self>>(&mut self, n: usize) -> Result<T> { ... }
fn parse_zero_terminated<T: Parse<Self>>(&mut self) -> Result<(Vec<u8>, T)> { ... }
fn parse_compare<T: Parse<Self>>(&mut self, c: &[u8]) -> Result<Option<T>> { ... }
fn consume(self, f: impl FnMut(&mut Self) -> Result<()>) -> Result<()> { ... }
fn parse_collect<T: ParseInline<Self>, B: FromIterator<T>>(
self,
) -> Result<B> { ... }
fn collect<T, B: FromIterator<T>>(
self,
f: impl FnMut(&mut Self) -> Result<T>,
) -> Result<B> { ... }
fn iter<T>(
self,
f: impl FnMut(&mut Self) -> Result<T>,
) -> impl Iterator<Item = Result<T>> { ... }
fn parse_inline<T: ParseInline<Self>>(&mut self) -> Result<T> { ... }
fn parse<T: Parse<Self>>(self) -> Result<T> { ... }
fn parse_vec<T: ParseInline<Self>>(self) -> Result<Vec<T>> { ... }
fn parse_vec_n<T: ParseInline<Self>>(&mut self, n: usize) -> Result<Vec<T>> { ... }
fn parse_array<T: ParseInline<Self>, const N: usize>(
&mut self,
) -> Result<[T; N]> { ... }
fn parse_generic_array<T: ParseInline<Self>, N: ArrayLength>(
&mut self,
) -> Result<GenericArray<T, N>> { ... }
}Required Associated Types§
Required Methods§
fn push_front(&mut self, data: impl Into<Vec<u8>>) -> Result<()>
fn read(&mut self, data: &mut [u8]) -> Result<()>
fn split_n(&mut self, n: usize) -> Result<Self>
fn skip_n(&mut self, n: usize) -> Result<()>
fn find_zero(&mut self) -> Result<usize>
fn parse_n_ahead(&mut self, n: usize) -> Result<Vec<u8>>
fn compare_ahead(&mut self, c: &[u8]) -> Result<bool>
fn parse_all(self) -> Result<Self::Data>
fn empty(self) -> Result<()>
fn non_empty(self) -> Result<Option<Self>>
Provided Methods§
fn parse_chunk<const N: usize>(&mut self) -> Result<[u8; N]>
fn split_parse<T: Parse<Self>>(&mut self, n: usize) -> Result<T>
fn parse_zero_terminated<T: Parse<Self>>(&mut self) -> Result<(Vec<u8>, T)>
fn parse_compare<T: Parse<Self>>(&mut self, c: &[u8]) -> Result<Option<T>>
fn consume(self, f: impl FnMut(&mut Self) -> Result<()>) -> Result<()>
fn parse_collect<T: ParseInline<Self>, B: FromIterator<T>>(self) -> Result<B>
fn collect<T, B: FromIterator<T>>( self, f: impl FnMut(&mut Self) -> Result<T>, ) -> Result<B>
fn iter<T>( self, f: impl FnMut(&mut Self) -> Result<T>, ) -> impl Iterator<Item = Result<T>>
fn parse_inline<T: ParseInline<Self>>(&mut self) -> Result<T>
fn parse<T: Parse<Self>>(self) -> Result<T>
fn parse_vec<T: ParseInline<Self>>(self) -> Result<Vec<T>>
fn parse_vec_n<T: ParseInline<Self>>(&mut self, n: usize) -> Result<Vec<T>>
fn parse_array<T: ParseInline<Self>, const N: usize>( &mut self, ) -> Result<[T; N]>
fn parse_generic_array<T: ParseInline<Self>, N: ArrayLength>( &mut self, ) -> Result<GenericArray<T, N>>
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.