| Crates.io | rx_core_operator_scan |
| lib.rs | rx_core_operator_scan |
| version | 0.2.0 |
| created_at | 2026-01-19 18:24:10.615805+00 |
| updated_at | 2026-01-24 15:09:30.024986+00 |
| description | scan operator for rx_core |
| homepage | https://github.com/AlexAegis/rx_bevy |
| repository | https://github.com/AlexAegis/rx_bevy |
| max_upload_size | |
| id | 2055068 |
| size | 14,173 |
Accumulate state and emit every intermediate result.
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