Stream

Trait Stream 

Source
pub trait Stream<T> {
    // Required methods
    fn peek(&mut self) -> Option<&T>;
    fn next(&mut self) -> Option<&T>;
    fn while_if<F>(&mut self, cond: F)
       where F: Fn(&T) -> bool;
    fn next_if<F>(&mut self, cond: F) -> bool
       where F: Fn(&T) -> bool;
    fn expect(&mut self, it: &[T]) -> bool;
    fn position(&self) -> usize;
    fn finish(&self) -> bool;
    fn skip(&mut self);
    fn skip_by(&mut self, size: usize);
    fn anchor(&mut self);
    fn read(&mut self) -> &[T];
}

Required Methods§

Source

fn peek(&mut self) -> Option<&T>

Source

fn next(&mut self) -> Option<&T>

Source

fn while_if<F>(&mut self, cond: F)
where F: Fn(&T) -> bool,

Source

fn next_if<F>(&mut self, cond: F) -> bool
where F: Fn(&T) -> bool,

Source

fn expect(&mut self, it: &[T]) -> bool

Source

fn position(&self) -> usize

Source

fn finish(&self) -> bool

Source

fn skip(&mut self)

Source

fn skip_by(&mut self, size: usize)

Source

fn anchor(&mut self)

Source

fn read(&mut self) -> &[T]

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a> Stream<u8> for SliceBytes<'a>

Source§

impl<'a> Stream<u8> for StrStream<'a>