| Crates.io | rx_core_operator_lift_result |
| lib.rs | rx_core_operator_lift_result |
| version | 0.2.0 |
| created_at | 2026-01-19 16:47:18.58081+00 |
| updated_at | 2026-01-24 15:07:54.260283+00 |
| description | lift_result operator for rx_core |
| homepage | https://github.com/AlexAegis/rx_bevy |
| repository | https://github.com/AlexAegis/rx_bevy |
| max_upload_size | |
| id | 2054946 |
| size | 15,219 |
Split Result values into next and error signals.
Result values.Never as the error type to guard pipelines at compile time.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