operator_map
Transform each value with a mapping function.
See Also
- MapIntoOperator -
Map each value using
Into. - MapErrorOperator - Transform error values into another error value.
- MapNeverOperator -
Re-type
Neversignals into concrete types. - MaterializeOperator - Turn next/error/complete into notification values.
- DematerializeOperator - Convert notifications back into real signals.
- EnumerateOperator - Attach a running index to each emission.
- PairwiseOperator - Emit the previous and current values together.
Example
cargo run -p rx_core --example operator_map_example
let _subscription = (1..=5)
.into_observable()
.map(|i| i * 2)
.subscribe(PrintObserver::new("map_operator"));
Output:
map_operator - next: 2
map_operator - next: 4
map_operator - next: 6
map_operator - next: 8
map_operator - next: 10
map_operator - completed
map_operator - unsubscribed