Trait ParseInput

Source
pub trait ParseInput: Sized {
Show 13 methods // Required methods fn parse_chunk<'a, const N: usize>(&mut self) -> Result<&'a [u8; N]> where Self: 'a; fn parse_n<'a>(&mut self, n: usize) -> Result<&'a [u8]> where Self: 'a; fn parse_ahead<T: Parse<Self>>(&mut self, n: usize) -> Result<T>; fn parse_compare<T: ParseInline<Self>>( &mut self, n: usize, c: &[u8], ) -> Result<Option<T>>; fn parse_all<'a>(self) -> &'a [u8] where Self: 'a; fn empty(self) -> Result<()>; fn non_empty(self) -> Option<Self>; // Provided methods 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) -> T) -> B { ... } fn iter<T>(self, f: impl FnMut(&mut Self) -> T) -> impl Iterator<Item = T> { ... } fn parse_inline<T: ParseInline<Self>>(&mut self) -> Result<T> { ... } fn parse<T: Parse<Self>>(self) -> Result<T> { ... }
}

Required Methods§

Source

fn parse_chunk<'a, const N: usize>(&mut self) -> Result<&'a [u8; N]>
where Self: 'a,

Source

fn parse_n<'a>(&mut self, n: usize) -> Result<&'a [u8]>
where Self: 'a,

Source

fn parse_ahead<T: Parse<Self>>(&mut self, n: usize) -> Result<T>

Source

fn parse_compare<T: ParseInline<Self>>( &mut self, n: usize, c: &[u8], ) -> Result<Option<T>>

Source

fn parse_all<'a>(self) -> &'a [u8]
where Self: 'a,

Source

fn empty(self) -> Result<()>

Source

fn non_empty(self) -> Option<Self>

Provided Methods§

Source

fn consume(self, f: impl FnMut(&mut Self) -> Result<()>) -> Result<()>

Source

fn parse_collect<T: ParseInline<Self>, B: FromIterator<T>>(self) -> Result<B>

Source

fn collect<T, B: FromIterator<T>>(self, f: impl FnMut(&mut Self) -> T) -> B

Source

fn iter<T>(self, f: impl FnMut(&mut Self) -> T) -> impl Iterator<Item = T>

Source

fn parse_inline<T: ParseInline<Self>>(&mut self) -> Result<T>

Source

fn parse<T: Parse<Self>>(self) -> Result<T>

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.

Implementors§