operator_map_never
Re-type Never next/error channels into concrete types.
See Also
- MapOperator - Transform each value with a mapping function.
- MapIntoOperator -
Map each value using
Into. - MapErrorOperator - Transform error values into another error value.
- 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_never_example
let _subscription_error = throw("error")
.map_never()
.subscribe(PrintObserver::<i32, &'static str>::new("map_never (next)"));
let _subscription_next = just(1)
.map_never()
.subscribe(PrintObserver::<i32, &'static str>::new("map_never (error)"));
let _subscription_both = empty()
.map_never_both()
.subscribe(PrintObserver::<i32, &'static str>::new("map_never_both"));
Output:
map_never (next) - error: "error"
map_never (next) - unsubscribed
map_never (error) - next: 1
map_never (error) - completed
map_never (error) - unsubscribed
map_never_both - completed
map_never_both - unsubscribed