rx_core_operator_count

Crates.iorx_core_operator_count
lib.rsrx_core_operator_count
version0.2.0
created_at2026-01-22 19:43:40.145001+00
updated_at2026-01-24 15:05:22.659862+00
descriptioncount operator for rx_core
homepagehttps://github.com/AlexAegis/rx_bevy
repositoryhttps://github.com/AlexAegis/rx_bevy
max_upload_size
id2062455
size13,358
Sandor (AlexAegis)

documentation

https://github.com/AlexAegis/rx_bevy

README

operator_count

crates.io ci codecov license

The count operator counts upstream emissions and emits the total once upstream completes.

See Also

  • IsEmptyOperator - Emit a single boolean indicating if the source emitted anything before it had completed.
  • FilterOperator - Keep values that satisfy a predicate.
  • ReduceOperator - Fold values and emit only the final accumulator on completion.

Example

cargo run -p rx_core --example operator_count_example
let _subscription = (1..=6)
  .into_observable()
  .filter(|value, _index| value % 2 == 0)
  .count()
  .subscribe(PrintObserver::new("count_operator"));

Output:

count_operator - next: 3
count_operator - completed
count_operator - unsubscribed
Commit count: 652

cargo fmt