Trait nom::Consumer
[−]
[src]
pub trait Consumer<I, O, E, M> { fn handle(&mut self, input: Input<I>) -> &ConsumerState<O, E, M>; fn state(&self) -> &ConsumerState<O, E, M>; }
The Consumer trait wraps a computation and its state
it depends on the input type I, the produced value's type O, the error type E, and the message type M
Required Methods
fn handle(&mut self, input: Input<I>) -> &ConsumerState<O, E, M>
implement hndle for the current computation, returning the new state of the consumer
fn state(&self) -> &ConsumerState<O, E, M>
returns the current state
Implementors
impl<'a, R, S: Clone, T, E: Clone, M: Clone, F: Fn(S) -> T, C: Consumer<R, S, E, M>> Consumer<R, T, E, M> for MapConsumer<'a, C, R, S, T, E, M, F>
impl<'a, 'b, R, S: Clone, T: Clone, E: Clone, M: Clone, C1: Consumer<R, S, E, M>, C2: Consumer<S, T, E, M>> Consumer<R, T, E, M> for ChainConsumer<'a, 'b, C1, C2, R, S, T, E, M>