operator_into_result
Error handling operator. Captures upstream values and errors, and forwards them
downstream as a Result.
See Also
- CatchOperator - On error, switch to a recovery observable.
- RetryOperator - Resubscribe on error up to the configured retry count.
- LiftResultOperator -
Split
Resultvalues into next and error signals. - ErrorBoundaryOperator -
Enforce
Neveras the error type to guard pipelines at compile time.
Example
cargo run -p rx_core --example operator_into_result_example
let _s = throw("error!".to_string())
.into_result()
.subscribe(PrintObserver::new("into_result_operator - throw"));
let _s = just(1)
.into_result()
.subscribe(PrintObserver::new("into_result_operator - just"));
into_result_operator - throw - next: Err("error!")
into_result_operator - throw - unsubscribed
into_result_operator - just - next: Ok(1)
into_result_operator - just - completed
into_result_operator - just - unsubscribed