Trait Stream

Source
pub trait Stream: Clone {
    type Item: Positioner;

    // Required method
    fn uncons(self) -> Result<(Self::Item, Self), Error<Self::Item>>;
}
Expand description

A stream is a sequence of items that can be extracted one by one

Required Associated Types§

Required Methods§

Source

fn uncons(self) -> Result<(Self::Item, Self), Error<Self::Item>>

Takes a stream and removes its first item, yielding the item and the rest of the elements Returns Err when no more elements could be retrieved

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.

Implementations on Foreign Types§

Source§

impl<'a> Stream for &'a str

Source§

type Item = char

Source§

fn uncons(self) -> Result<(char, &'a str), Error<char>>

Source§

impl<'a, T> Stream for &'a [T]
where T: Positioner,

Implementors§