Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

operator_map_into

crates.io ci codecov license

Map each value using Into.

See Also

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