stream-operators

Crates.iostream-operators
lib.rsstream-operators
version0.1.1
sourcesrc
created_at2022-10-21 05:50:05.379732
updated_at2023-01-11 04:50:05.210696
descriptiona collection of selected rxjs operators for rust standard Stream
homepagehttps://github.com/tyrchen/stream-operators
repositoryhttps://github.com/tyrchen/stream-operators
max_upload_size
id693203
size35,554
Tyr Chen (tyrchen)

documentation

https://docs.rs/stream-operators

README

Stream Operators

This is a collection of selected rxjs operators for rust standard Stream. Though the operators are coming from the ReactiveX world, I'm not trying to reinvent the observable ecosystem for rust. If you need that, you could use rxrust. For this repom I'm just trying to provide a set of stream operators which could be used for Stream.

Supported Operators

  • debounce_time
  • distinct_until_changed
  • distinct
  • pluck: Maps each source value to its specified nested property.
  • find: Emits the first value that matches the condition.
  • find_index: Emits the index of the first value that matches the condition.
  • group_by: Groups the items emitted by an Observable according to a specified criterion, and emits these grouped items as GroupedObservables, one GroupedObservable per group.
  • pairwise: Emits the previous and current value as a two-element array.
  • partition: Splits the source Observable into two, one with values that satisfy a predicate, and another with values that don't satisfy the predicate.
  • sample_time: Samples the source Observable at periodic time intervals, emitting the most recent value emitted by the source Observable since the previous sampling, unless the source has not emitted anything since the previous sampling.
  • sequence_equal: Determines whether two Observables emit the same sequence of items.
  • throttle_time: Emits a value from the source Observable, then ignores subsequent source values for a duration determined by another Observable, then repeats this process.

Operators supported by tokio-stream

Operators supported by futures

Usage

See tests for each operator.

Commit count: 7

cargo fmt