rx_core_operator_scan

Crates.iorx_core_operator_scan
lib.rsrx_core_operator_scan
version0.2.0
created_at2026-01-19 18:24:10.615805+00
updated_at2026-01-24 15:09:30.024986+00
descriptionscan operator for rx_core
homepagehttps://github.com/AlexAegis/rx_bevy
repositoryhttps://github.com/AlexAegis/rx_bevy
max_upload_size
id2055068
size14,173
Sandor (AlexAegis)

documentation

https://github.com/AlexAegis/rx_bevy

README

operator_scan

crates.io ci codecov license

Accumulate state and emit every intermediate result.

See Also

  • ReduceOperator - Fold values and emit only the final accumulator on completion.

Example

cargo run -p rx_core --example operator_scan_example
let _subscription = (0..=10)
    .into_observable()
    .scan(|acc, next| acc + next, 0)
    .subscribe(PrintObserver::new("scan_operator"));

Output:

scan_operator - next: 0
scan_operator - next: 1
scan_operator - next: 3
scan_operator - next: 6
scan_operator - next: 10
scan_operator - next: 15
scan_operator - next: 21
scan_operator - next: 28
scan_operator - next: 36
scan_operator - next: 45
scan_operator - next: 55
scan_operator - completed
Commit count: 652

cargo fmt