pub struct SliceStream<'a, T: 'a>(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 + 'a> Debug for SliceStream<'a, T>
impl<'a, T: Debug + 'a> 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> FullRangeStream for SliceStream<'a, T>where
T: PartialEq + 'a,
impl<'a, T> FullRangeStream for SliceStream<'a, T>where
T: PartialEq + 'a,
Source§impl<'a, T: Ord + 'a> Ord for SliceStream<'a, T>
impl<'a, T: Ord + 'a> 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 + 'a> PartialEq for SliceStream<'a, T>
impl<'a, T: PartialEq + 'a> PartialEq for SliceStream<'a, T>
Source§impl<'a, T: PartialOrd + 'a> PartialOrd for SliceStream<'a, T>
impl<'a, T: PartialOrd + 'a> 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,
) -> FastResult<Self::Range, StreamErrorFor<Self>>
fn uncons_while1<F>( &mut self, f: F, ) -> FastResult<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> Resetable for SliceStream<'a, T>
impl<'a, T> Resetable for SliceStream<'a, T>
type Checkpoint = SliceStream<'a, T>
fn checkpoint(&self) -> Self
fn reset(&mut self, checkpoint: Self)
Source§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::Item
for this type.Source§type Position = PointerOffset
type Position = PointerOffset
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 item, yielding the item 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 + 'a> Copy for SliceStream<'a, T>
impl<'a, T: Eq + 'a> Eq for SliceStream<'a, T>
impl<'a, T: 'a> 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more