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

The input item type, usually depending on which DataSource is used.

Required Methods

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