pub struct SliceStream<'a, T>(pub &'a [T]);
Expand description
Newtype for constructing a stream from a slice where the items in the slice are not copyable.
Tuple Fields§
§0: &'a [T]
Trait Implementations§
Source§impl<'a, T> Clone for SliceStream<'a, T>
impl<'a, T> Clone for SliceStream<'a, T>
Source§fn clone(&self) -> SliceStream<'a, T>
fn clone(&self) -> SliceStream<'a, T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a, T: Debug> Debug for SliceStream<'a, T>
impl<'a, T: Debug> Debug for SliceStream<'a, T>
Source§impl<'a, T> DefaultPositioned for SliceStream<'a, T>
impl<'a, T> DefaultPositioned for SliceStream<'a, T>
type Positioner = IndexPositioner
Source§impl<'a, T: Ord> Ord for SliceStream<'a, T>
impl<'a, T: Ord> Ord for SliceStream<'a, T>
Source§fn cmp(&self, other: &SliceStream<'a, T>) -> Ordering
fn cmp(&self, other: &SliceStream<'a, T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a, T: PartialEq> PartialEq for SliceStream<'a, T>
impl<'a, T: PartialEq> PartialEq for SliceStream<'a, T>
Source§impl<'a, T: PartialOrd> PartialOrd for SliceStream<'a, T>
impl<'a, T: PartialOrd> PartialOrd for SliceStream<'a, T>
Source§impl<'a, T> Positioned for SliceStream<'a, T>where
T: PartialEq + 'a,
impl<'a, T> Positioned for SliceStream<'a, T>where
T: PartialEq + 'a,
Source§impl<'a, T> RangeStreamOnce for SliceStream<'a, T>where
T: PartialEq + 'a,
impl<'a, T> RangeStreamOnce for SliceStream<'a, T>where
T: PartialEq + 'a,
Source§fn uncons_range(&mut self, size: usize) -> Result<&'a [T], StreamErrorFor<Self>>
fn uncons_range(&mut self, size: usize) -> Result<&'a [T], StreamErrorFor<Self>>
Takes
size
elements from the stream.
Fails if the length of the stream is less than size
.Source§fn uncons_while<F>(&mut self, f: F) -> Result<&'a [T], StreamErrorFor<Self>>
fn uncons_while<F>(&mut self, f: F) -> Result<&'a [T], StreamErrorFor<Self>>
Takes items from stream, testing each one with
predicate
.
returns the range of items which passed predicate
.Source§fn uncons_while1<F>(
&mut self,
f: F,
) -> ParseResult<Self::Range, StreamErrorFor<Self>>
fn uncons_while1<F>( &mut self, f: F, ) -> ParseResult<Self::Range, StreamErrorFor<Self>>
Takes items from stream, testing each one with
predicate
returns a range of at least one items which passed predicate
. Read moreSource§impl<'a, T> ResetStream for SliceStream<'a, T>where
Self: StreamOnce,
impl<'a, T> ResetStream for SliceStream<'a, T>where
Self: StreamOnce,
type Checkpoint = SliceStream<'a, T>
Source§fn checkpoint(&self) -> Self
fn checkpoint(&self) -> Self
Creates a
Checkpoint
at the current position which can be used to reset the stream
later to the current positionSource§impl<'a, T> StreamOnce for SliceStream<'a, T>where
T: PartialEq + 'a,
impl<'a, T> StreamOnce for SliceStream<'a, T>where
T: PartialEq + 'a,
Source§type Range = &'a [T]
type Range = &'a [T]
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.Source§type Position = PointerOffset<[T]>
type Position = PointerOffset<[T]>
Type which represents the position in a stream.
Ord
is required to allow parsers to determine which of two positions are further ahead.type Error = UnexpectedParse
Source§fn uncons(&mut self) -> Result<&'a T, StreamErrorFor<Self>>
fn uncons(&mut self) -> Result<&'a T, StreamErrorFor<Self>>
Takes a stream and removes its first token, yielding the token and the rest of the elements.
Returns
Err
if no element could be retrieved.Source§fn is_partial(&self) -> bool
fn is_partial(&self) -> bool
Returns
true
if this stream only contains partial input. Read moreimpl<'a, T: Copy> Copy for SliceStream<'a, T>
impl<'a, T: Eq> Eq for SliceStream<'a, T>
impl<'a, T> StructuralPartialEq for SliceStream<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for SliceStream<'a, T>
impl<'a, T> RefUnwindSafe for SliceStream<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for SliceStream<'a, T>where
T: Sync,
impl<'a, T> Sync for SliceStream<'a, T>where
T: Sync,
impl<'a, T> Unpin for SliceStream<'a, T>
impl<'a, T> UnwindSafe for SliceStream<'a, T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more