Struct frappe::Stream [] [src]

pub struct Stream<T> { /* fields omitted */ }

A stream of discrete events sent over time.

All the objects that result from stream operations contain an internal reference to it's parent, so dropping intermediate temporary streams (like the ones created from chaining methods) won't break the chain.

Methods

impl<T> Stream<T>
[src]

[src]

Creates a stream that never fires.

impl<T: 'static> Stream<T>
[src]

[src]

Maps this stream into another stream using the provided function.

[src]

Creates a new stream that only contains the values where the predicate is true.

[src]

Filter and map a stream simultaneously.

[src]

Creates a new stream that fires with the events from both streams.

[src]

Merges two streams of different types using two functions that return the same type.

[src]

Accumulates the values sent over this stream.

The fold operation is done by taking the accumulator, consuming it's value, and then putting back the transformed value. This avoids cloning, but if the closure panics it will leave the storage empty, and then any sampling attempt on this object will panic until someone puts back a value on it. If this is undesirable, use Stream::fold_clone instead.

[src]

Folds the stream by cloning the accumulator.

This will clone the accumulator on every value processed, but if the closure panics, the storage will remain unchanged and later attempts at sampling will succeed like nothing happened.

[src]

Maps each stream event to 0..N output values.

The closure must return it's value by sending it through the provided sink. Multiple values (or none) can be sent to the output stream this way.

This primitive is useful to construct asynchronous operations, since you can store the sink for later usage.

[src]

Reads the values without modifying them.

This is meant to be used as a debugging tool and not to cause side effects.

impl<T: Clone + 'static> Stream<T>
[src]

[src]

Creates a Signal that holds the last value sent to this stream.

[src]

Holds the last value in this stream where the predicate is true.

[src]

Creates a collection from the values of this stream.

[src]

Creates a channel and sends the stream events through it.

This doesn't create a strong reference to the parent stream, so the channel sender will be dropped when the stream is deleted.

impl<T: Clone + 'static> Stream<Option<T>>
[src]

[src]

Filters a stream of Option, returning the unwrapped Some values

impl<T: SumType2 + Clone + 'static> Stream<T> where
    T::Type1: 'static,
    T::Type2: 'static, 
[src]

[src]

Creates a stream with only the first element of a sum type

[src]

Creates a stream with only the second element of a sum type

[src]

Splits a two element sum type stream into two streams with the unwrapped values

impl<T: 'static> Stream<Stream<T>>
[src]

[src]

Listens to the events from the last stream sent to a nested stream

Trait Implementations

impl<T: Debug> Debug for Stream<T>
[src]

[src]

Formats the value using the given formatter.

impl<T> Clone for Stream<T>
[src]

[src]

Creates a copy of this stream that references the same event chain.

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T> Default for Stream<T>
[src]

[src]

Creates a stream that never fires.