[−][src]Struct combine::stream::position::Stream
The Stream<Input>
struct maintains the current position in the stream Input
using
the Positioner
trait to track the position.
let result = token(b'9') .message("Not a nine") .easy_parse(position::Stream::new(&b"8"[..])); assert_eq!(result, Err(easy::Errors { position: 0, errors: vec![ easy::Error::Unexpected(b'8'.into()), easy::Error::Expected(b'9'.into()), easy::Error::Message("Not a nine".into()) ] }));
Fields
input: Input
The input stream used when items are requested
positioner: X
The positioner used to update the current position
Implementations
impl<Input, X> Stream<Input, X> where
Input: StreamOnce,
X: Positioner<Input::Token>,
[src]
Input: StreamOnce,
X: Positioner<Input::Token>,
pub fn with_positioner(input: Input, positioner: X) -> Stream<Input, X>
[src]
Creates a new Stream<Input, X>
from an input stream and a positioner.
impl<Input> Stream<Input, Input::Positioner> where
Input: StreamOnce + DefaultPositioned,
Input::Positioner: Positioner<Input::Token>,
[src]
Input: StreamOnce + DefaultPositioned,
Input::Positioner: Positioner<Input::Token>,
pub fn new(input: Input) -> Stream<Input, Input::Positioner>
[src]
Creates a new Stream<Input, X>
from an input stream and its default positioner.
Trait Implementations
impl<Input: Clone, X: Clone> Clone for Stream<Input, X>
[src]
impl<Input: Debug, X: Debug> Debug for Stream<Input, X>
[src]
impl<Input: PartialEq, X: PartialEq> PartialEq<Stream<Input, X>> for Stream<Input, X>
[src]
fn eq(&self, other: &Stream<Input, X>) -> bool
[src]
fn ne(&self, other: &Stream<Input, X>) -> bool
[src]
impl<Input, X, E> Positioned for Stream<Input, X> where
Input: StreamOnce,
X: Positioner<Input::Token>,
E: StreamError<Input::Token, Input::Range>,
Input::Error: ParseError<Input::Token, Input::Range, X::Position, StreamError = E>,
Input::Error: ParseError<Input::Token, Input::Range, Input::Position, StreamError = E>,
[src]
Input: StreamOnce,
X: Positioner<Input::Token>,
E: StreamError<Input::Token, Input::Range>,
Input::Error: ParseError<Input::Token, Input::Range, X::Position, StreamError = E>,
Input::Error: ParseError<Input::Token, Input::Range, Input::Position, StreamError = E>,
impl<Input, X, S> RangeStreamOnce for Stream<Input, X> where
Input: RangeStreamOnce,
X: RangePositioner<Input::Token, Input::Range>,
S: StreamError<Input::Token, Input::Range>,
Input::Error: ParseError<Input::Token, Input::Range, X::Position, StreamError = S>,
Input::Error: ParseError<Input::Token, Input::Range, Input::Position, StreamError = S>,
Input::Position: Clone + Ord,
[src]
Input: RangeStreamOnce,
X: RangePositioner<Input::Token, Input::Range>,
S: StreamError<Input::Token, Input::Range>,
Input::Error: ParseError<Input::Token, Input::Range, X::Position, StreamError = S>,
Input::Error: ParseError<Input::Token, Input::Range, Input::Position, StreamError = S>,
Input::Position: Clone + Ord,
fn uncons_range(
&mut self,
size: usize
) -> Result<Input::Range, StreamErrorFor<Self>>
[src]
&mut self,
size: usize
) -> Result<Input::Range, StreamErrorFor<Self>>
fn uncons_while<F>(
&mut self,
predicate: F
) -> Result<Input::Range, StreamErrorFor<Self>> where
F: FnMut(Input::Token) -> bool,
[src]
&mut self,
predicate: F
) -> Result<Input::Range, StreamErrorFor<Self>> where
F: FnMut(Input::Token) -> bool,
fn uncons_while1<F>(
&mut self,
predicate: F
) -> ParseResult<Self::Range, StreamErrorFor<Self>> where
F: FnMut(Self::Token) -> bool,
[src]
&mut self,
predicate: F
) -> ParseResult<Self::Range, StreamErrorFor<Self>> where
F: FnMut(Self::Token) -> bool,
fn distance(&self, end: &Self::Checkpoint) -> usize
[src]
fn range(&self) -> Self::Range
[src]
impl<Input, X, S> ResetStream for 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>,
Input::Error: ParseError<Input::Token, Input::Range, Input::Position, StreamError = S>,
[src]
Input: ResetStream,
X: Positioner<Input::Token>,
S: StreamError<Input::Token, Input::Range>,
Input::Error: ParseError<Input::Token, Input::Range, X::Position, StreamError = S>,
Input::Error: ParseError<Input::Token, Input::Range, Input::Position, StreamError = S>,
type Checkpoint = Stream<Input::Checkpoint, X::Checkpoint>
fn checkpoint(&self) -> Self::Checkpoint
[src]
fn reset(&mut self, checkpoint: Self::Checkpoint) -> Result<(), Self::Error>
[src]
impl<Input, X, S> StreamOnce for Stream<Input, X> where
Input: StreamOnce,
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>,
[src]
Input: StreamOnce,
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>,
type Token = Input::Token
The type of items which is yielded from this stream.
type Range = Input::Range
The type of a range of items yielded from this stream.
Types which do not a have a way of yielding ranges of items should just use the
Self::Token
for this type. Read more
type Position = X::Position
Type which represents the position in a stream.
Ord
is required to allow parsers to determine which of two positions are further ahead. Read more
type Error = Input::Error
fn uncons(&mut self) -> Result<Input::Token, StreamErrorFor<Self>>
[src]
fn is_partial(&self) -> bool
[src]
impl<Input, X> StructuralPartialEq for Stream<Input, X>
[src]
Auto Trait Implementations
impl<Input, X> RefUnwindSafe for Stream<Input, X> where
Input: RefUnwindSafe,
X: RefUnwindSafe,
Input: RefUnwindSafe,
X: RefUnwindSafe,
impl<Input, X> Send for Stream<Input, X> where
Input: Send,
X: Send,
Input: Send,
X: Send,
impl<Input, X> Sync for Stream<Input, X> where
Input: Sync,
X: Sync,
Input: Sync,
X: Sync,
impl<Input, X> Unpin for Stream<Input, X> where
Input: Unpin,
X: Unpin,
Input: Unpin,
X: Unpin,
impl<Input, X> UnwindSafe for Stream<Input, X> where
Input: UnwindSafe,
X: UnwindSafe,
Input: UnwindSafe,
X: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow(&self) -> &TⓘNotable traits for &'_ mut W
impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;
[src]
Notable traits for &'_ mut W
impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut TⓘNotable traits for &'_ mut W
impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;
[src]
Notable traits for &'_ mut W
impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<Input> RangeStream for Input where
Input: RangeStreamOnce + Stream,
[src]
Input: RangeStreamOnce + Stream,
impl<Input> Stream for Input where
Input: StreamOnce + Positioned + ResetStream,
<Input as StreamOnce>::Error: ParseError<<Input as StreamOnce>::Token, <Input as StreamOnce>::Range, <Input as StreamOnce>::Position>,
[src]
Input: StreamOnce + Positioned + ResetStream,
<Input as StreamOnce>::Error: ParseError<<Input as StreamOnce>::Token, <Input as StreamOnce>::Range, <Input as StreamOnce>::Position>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,