Trait chomp::buffer::Stream
[−]
[src]
pub trait Stream<'a, 'i> { type Input: Input + 'i; fn parse<F, T, E>(
&'a mut self,
f: F
) -> Result<T, StreamError<<Self::Input as Input>::Buffer, E>>
where
F: FnOnce(Self::Input) -> ParseResult<Self::Input, T, E>,
T: 'i,
E: 'i; }
Trait wrapping the state management in reading from a data source while parsing.
Associated Types
Required Methods
fn parse<F, T, E>(
&'a mut self,
f: F
) -> Result<T, StreamError<<Self::Input as Input>::Buffer, E>> where
F: FnOnce(Self::Input) -> ParseResult<Self::Input, T, E>,
T: 'i,
E: 'i,
&'a mut self,
f: F
) -> Result<T, StreamError<<Self::Input as Input>::Buffer, E>> where
F: FnOnce(Self::Input) -> ParseResult<Self::Input, T, E>,
T: 'i,
E: 'i,
Attempts to run the supplied parser F
once on the currently populated data in this
stream, providing a borrow of the inner data storage.
If a StreamError::Retry
is returned the consuming code it should just retry the action
(the implementation might require a separate call to refill the stream).
Implementors
impl<'a, S: DataSource, B: Buffer<S::Item>> Stream<'a, 'a> for Source<S, B> where
S::Item: 'a,impl<'a, 'i, I: 'i + Copy + PartialEq> Stream<'a, 'i> for SliceStream<'i, I>