combine::stream

Trait ResetStream

Source
pub trait ResetStream: StreamOnce {
    type Checkpoint: Clone;

    // Required methods
    fn checkpoint(&self) -> Self::Checkpoint;
    fn reset(&mut self, checkpoint: Self::Checkpoint) -> Result<(), Self::Error>;
}
Expand description

A StreamOnce which can create checkpoints which the stream can be reset to

Required Associated Types§

Required Methods§

Source

fn checkpoint(&self) -> Self::Checkpoint

Creates a Checkpoint at the current position which can be used to reset the stream later to the current position

Source

fn reset(&mut self, checkpoint: Self::Checkpoint) -> Result<(), Self::Error>

Attempts to reset the stream to an earlier position.

Implementations on Foreign Types§

Source§

impl<'a> ResetStream for &'a str
where Self: StreamOnce,

Source§

type Checkpoint = &'a str

Source§

fn checkpoint(&self) -> Self

Source§

fn reset(&mut self, checkpoint: Self) -> Result<(), Self::Error>

Source§

impl<'a, I> ResetStream for &'a mut I
where I: ResetStream + ?Sized,

Source§

type Checkpoint = <I as ResetStream>::Checkpoint

Source§

fn checkpoint(&self) -> Self::Checkpoint

Source§

fn reset(&mut self, checkpoint: Self::Checkpoint) -> Result<(), Self::Error>

Source§

impl<'a, T> ResetStream for &'a [T]
where Self: StreamOnce,

Source§

type Checkpoint = &'a [T]

Source§

fn checkpoint(&self) -> Self

Source§

fn reset(&mut self, checkpoint: Self) -> Result<(), Self::Error>

Implementors§

Source§

impl<'a, T> ResetStream for SliceStream<'a, T>
where Self: StreamOnce,

Source§

impl<Input> ResetStream for combine::stream::buffered::Stream<Input>
where Input: Positioned,

Source§

impl<Input, X, S> ResetStream for combine::stream::position::Stream<Input, X>
where Input: ResetStream, X: Positioner<Input::Token>, S: StreamError<Input::Token, Input::Range>, Input::Error: ParseError<Input::Token, Input::Range, X::Position, StreamError = S> + ParseError<Input::Token, Input::Range, Input::Position, StreamError = S>,

Source§

impl<S> ResetStream for combine::easy::Stream<S>

Source§

impl<S> ResetStream for CompleteStream<S>
where S: ResetStream,

Source§

impl<S> ResetStream for MaybePartialStream<S>
where S: ResetStream,

Source§

impl<S> ResetStream for PartialStream<S>
where S: ResetStream,

Source§

impl<S, E> ResetStream for combine::stream::span::Stream<S, E>

Source§

impl<S, U> ResetStream for combine::stream::state::Stream<S, U>
where S: ResetStream,

Source§

impl<T: Clone> ResetStream for IteratorStream<T>
where Self: StreamOnce,