Stream

Enum Stream 

Source
pub enum Stream<T> {
    Cons(ProcessBox<(T, Stream<T>)>),
}
Expand description

An infinite stream of data.

Variants§

§

Cons(ProcessBox<(T, Stream<T>)>)

The cons-cell.

Implementations§

Source§

impl<T> Stream<T>

Source

pub fn run(self) -> ProcessBox<(T, Self)>

Run the stream computation.

Source

pub fn map<F, B>(self, f: F) -> Stream<B>
where F: Fn(T) -> B + 'static, B: 'static, T: 'static,

Map the stream according the specified function.

Source

pub fn mapc<F, M, B>(self, f: F) -> Stream<B>
where F: Fn(T) -> M + 'static, M: Event<Item = B> + 'static, B: 'static, T: 'static,

Compose the stream.

Source

pub fn accum<F, M, B, Acc>(self, f: F, acc: Acc) -> Stream<B>
where F: Fn(Acc, T) -> M + 'static, M: Event<Item = (Acc, B)> + 'static, B: 'static, T: 'static, Acc: 'static,

Accumulator that outputs a value determined by the specified function.

Source

pub fn filter<F>(self, pred: F) -> Self
where F: Fn(&T) -> bool + 'static, T: 'static,

Filter only those data values that satisfy to the specified predicate.

Source

pub fn filterc<F, M>(self, pred: F) -> Self
where F: Fn(&T) -> M + 'static, M: Event<Item = bool> + 'static, T: 'static,

Filter only those data values that satisfy to the specified predicate.

Source

pub fn take(self, n: isize) -> Self
where T: 'static,

Return the prefix of the stream of the specified length.

Source

pub fn take_while<F>(self, pred: F) -> Self
where F: Fn(&T) -> bool + 'static, T: 'static,

Return the longest prefix of the stream of elements that satisfy the predicate.

Source

pub fn take_while_c<F, M>(self, pred: F) -> Self
where F: Fn(&T) -> M + 'static, M: Event<Item = bool> + 'static, T: 'static,

Return the longest prefix of the stream of elements that satisfy the computations.

Source

pub fn drop(self, n: isize) -> Self
where T: 'static,

Return the suffix of the stream after the specified first elements.

Source

pub fn drop_while<F>(self, pred: F) -> Self
where F: Fn(&T) -> bool + 'static, T: 'static,

Return the suffix of the stream of elements remaining after take_while.

Source

pub fn drop_while_c<F, M>(self, pred: F) -> Self
where F: Fn(&T) -> M + 'static, M: Event<Item = bool> + 'static, T: 'static,

Return the suffix of the stream of elements remaining after take_while_c.

Auto Trait Implementations§

§

impl<T> Freeze for Stream<T>

§

impl<T> !RefUnwindSafe for Stream<T>

§

impl<T> !Send for Stream<T>

§

impl<T> !Sync for Stream<T>

§

impl<T> Unpin for Stream<T>

§

impl<T> !UnwindSafe for Stream<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V