pub struct Stream<'a> {
pub phases: Vec<Phase>,
/* private fields */
}
Fields§
§phases: Vec<Phase>
Implementations§
Source§impl<'a> Stream<'a>
impl<'a> Stream<'a>
pub fn new(source: &'a [u8]) -> Self
Sourcepub fn advance_by(&mut self, len: usize)
pub fn advance_by(&mut self, len: usize)
Advances the stream by len
bytes.
Sourcepub fn take(&mut self) -> Option<u8>
pub fn take(&mut self) -> Option<u8>
Returns the first character of the stream and advances. If at end of stream,
returns None
.
Sourcepub fn take_n<const N: usize>(&mut self) -> Option<[u8; N]>
pub fn take_n<const N: usize>(&mut self) -> Option<[u8; N]>
Returns the first character of the stream and advances. If at end of stream,
returns None
.
Sourcepub fn take_if<C: TakeCondition<'a>>(
&mut self,
condition: C,
) -> Option<C::Output>
pub fn take_if<C: TakeCondition<'a>>( &mut self, condition: C, ) -> Option<C::Output>
Advances the stream forward if condition
matches.
Sourcepub fn advance_if<C: TakeCondition<'a>>(&mut self, condition: C) -> bool
pub fn advance_if<C: TakeCondition<'a>>(&mut self, condition: C) -> bool
Advances the stream forward if condition
matches.
Trait Implementations§
impl<'a> StructuralPartialEq for Stream<'a>
Auto Trait Implementations§
impl<'a> Freeze for Stream<'a>
impl<'a> RefUnwindSafe for Stream<'a>
impl<'a> Send for Stream<'a>
impl<'a> Sync for Stream<'a>
impl<'a> Unpin for Stream<'a>
impl<'a> UnwindSafe for Stream<'a>
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