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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

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

§

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,

§

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,

§

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,

Available on crate feature alloc only.
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::stream::easy::Stream<S>

Available on crate feature std only.
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,