Crate asyncplify [] [src]

Functional Reactive Programming (FRP) library (RX like) for rust.

This library is the oposite of the iterator as those operators are pushed based instead of pull based like an iterator. It can serve as a base for async operations and coordinations.

Example

use asyncplify::*;

let v = (0..10)
    .into_stream()     // convert the iterator to stream
    .map(|v| v + 10)   // add 10 to all items coming from the stream
    .sum()             // sum all the values and push the sum to the stream
    .last_value()     // returns the last incoming values from the stream
    .unwrap();

println!("The sum is {}", v);

Most operators are available under the Stream trait.

License The MIT License (MIT)

Modules

schedulers

If you want to introduce multiple threads or delay, you can do so by using schedulers.

Structs

Clonable
Count
Debounce

Only emit an item from a Stream if a particular duration has passed without it emitting another item.

Dedup
DedupByKey
Empty

A Stream that do not emits any element.

Filter

This struct is created by the filter() method on Stream. See its documentation for more.

Flatmap
Fold
Group
GroupBy
Inspect
Interval
IterStream

Represent a stream on an iterator.

Map
Max
MaxByKey
Min
MinByKey
Once

A stream that emits an element exactly once.

ParallelEmpty

A ParallelStream that do not emits any element.

ParallelFilter

This struct is created by the filter() method on ParallelStream. See its documentation for more.

ParallelInspect
ParallelMax
ParallelMaxByKey
ParallelMinByKey
ParallelObserveOn
Scan
Skip

Ignores the first n items.

SkipLast

Ignores the last n items.

SkipUntil

Ignores items until another stream emit one item.

Sort

Accumulates all items inside a vec, sort the result and emit all values ordered.

Sum

Sum all the items and emit only a single item as the total.

SyncToParallelObserveOn
Take

Only emit the first n items of a stream.

TakeLast

Emit the last n items of a stream.

TakeUntil

Emit items until it receive an item from another stream.

ToVec
Unique
UniqueByKey
Zip

Traits

Consumer
IntoStream

Extend the Iterator trait with stream conversion operators

ParallelConsumer
ParallelStream
Stream

Functions

once

Creates a stream that emits an element exactly once.