Struct bidule::Stream [] [src]

pub struct Stream<'a, Sig> { /* fields omitted */ }

A stream of signals.

A stream represents a composable signal producer. When you decide to send a signal down a stream, any other streams composed with that first stream will also receive the signal. This enables to construct more interesting and complex streams by composing them.

Methods

impl<'a, Sig> Stream<'a, Sig> where
    Sig: 'a, 
[src]

[src]

Create a new stream.

[src]

Subscribe a new listener for this stream’s signals.

This function enables to “observe” any signal flowing out of the stream. However, do not abuse this function, as its primary use is to build other combinators.

[src]

Send a signal down the stream.

[src]

Map any signals flowing out a stream.

Please note that this function is total: you cannot ignore signals. Even if you map uninteresting signals to None, you’ll still compose signals for those. If are interested in filtering signals while mapping, have a look at the filter_map function.

[src]

Filter and map signals flowing out a stream.

If you’re not interested in a specific signal, you can emit None: no signal will be sent.

[src]

Filter the signals flowing out of a stream with a predicate.

[src]

Fold all signals flowing out of a stream into a stream of values.

[src]

Merge two streams into one.

Merging streams enables you to perform later useful compositions, such as folding the merged results.

[src]

Zip two streams with each other.

[src]

Create a pair of entangled streams.

If any of the streams sends a signal, the other one receives it. However, be careful: since the signals are defined in terms of each other, it’s quite easy to cause infinite loops if you don’t have a well-defined bottom to your recursion. This is why you’re expected to return Option<_> signals.

[src]

Sink a stream.

impl<'a, SigA, SigB> Stream<'a, Either<SigA, SigB>> where
    SigA: 'static,
    SigB: 'static, 
[src]

[src]

Split a stream of zipped values into two streams.