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>
impl<T> Stream<T>
Sourcepub fn run(self) -> ProcessBox<(T, Self)>
pub fn run(self) -> ProcessBox<(T, Self)>
Run the stream computation.
Sourcepub fn map<F, B>(self, f: F) -> Stream<B>where
F: Fn(T) -> B + 'static,
B: 'static,
T: 'static,
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.
Sourcepub fn accum<F, M, B, Acc>(self, f: F, acc: Acc) -> Stream<B>
pub fn accum<F, M, B, Acc>(self, f: F, acc: Acc) -> Stream<B>
Accumulator that outputs a value determined by the specified function.
Sourcepub fn filter<F>(self, pred: F) -> Self
pub fn filter<F>(self, pred: F) -> Self
Filter only those data values that satisfy to the specified predicate.
Sourcepub fn filterc<F, M>(self, pred: F) -> Self
pub fn filterc<F, M>(self, pred: F) -> Self
Filter only those data values that satisfy to the specified predicate.
Sourcepub fn take(self, n: isize) -> Selfwhere
T: 'static,
pub fn take(self, n: isize) -> Selfwhere
T: 'static,
Return the prefix of the stream of the specified length.
Sourcepub fn take_while<F>(self, pred: F) -> Self
pub fn take_while<F>(self, pred: F) -> Self
Return the longest prefix of the stream of elements that satisfy the predicate.
Sourcepub fn take_while_c<F, M>(self, pred: F) -> Self
pub fn take_while_c<F, M>(self, pred: F) -> Self
Return the longest prefix of the stream of elements that satisfy the computations.
Sourcepub fn drop(self, n: isize) -> Selfwhere
T: 'static,
pub fn drop(self, n: isize) -> Selfwhere
T: 'static,
Return the suffix of the stream after the specified first elements.
Sourcepub fn drop_while<F>(self, pred: F) -> Self
pub fn drop_while<F>(self, pred: F) -> Self
Return the suffix of the stream of elements remaining after take_while.
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> 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