operator_map_into
Map each value using Into.
See Also
- MapOperator - Transform each value with a mapping function.
- 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_into_example
#[derive(Debug)]
pub struct Foo(pub i32);
impl From<i32> for Foo {
fn from(value: i32) -> Self {
Foo(value)
}
}
let _subscription = (1..=5)
.into_observable()
.map_into()
.subscribe(PrintObserver::<Foo>::new("into_operator"));
Output:
into_operator - next: Foo(1)
into_operator - next: Foo(2)
into_operator - next: Foo(3)
into_operator - next: Foo(4)
into_operator - next: Foo(5)
into_operator - completed
into_operator - unsubscribed