rx_core_operator_lift_result

Crates.iorx_core_operator_lift_result
lib.rsrx_core_operator_lift_result
version0.2.0
created_at2026-01-19 16:47:18.58081+00
updated_at2026-01-24 15:07:54.260283+00
descriptionlift_result operator for rx_core
homepagehttps://github.com/AlexAegis/rx_bevy
repositoryhttps://github.com/AlexAegis/rx_bevy
max_upload_size
id2054946
size15,219
Sandor (AlexAegis)

documentation

https://github.com/AlexAegis/rx_bevy

README

operator_lift_result

crates.io ci codecov license

Split Result values into next and error signals.

See Also

Example

cargo run -p rx_core --example operator_lift_result_example
use rx_core::prelude::*;

fn main() {
  let _s = (1..=5)
    .into_observable()
    .map(|i| {
      if i <= 3 {
        Result::<i32, String>::Ok(i)
      } else {
        Result::<i32, String>::Err("Larger than 3!".to_string())
      }
    })
    // We're lifting the result error from the "next" channel, but we still have to deal with
    // upstream errors if they exist, this `unreachable!` is just here to ignore them.
    .lift_result()
    .subscribe(PrintObserver::new("lift_result_operator"));
}
lift_result_operator - next: 1
lift_result_operator - next: 2
lift_result_operator - next: 3
lift_result_operator - error: "Larger than 3!"
lift_result_operator - unsubscribed
Commit count: 652

cargo fmt