| Crates.io | rx_core_operator_error_boundary |
| lib.rs | rx_core_operator_error_boundary |
| version | 0.2.0 |
| created_at | 2026-01-19 14:03:35.587993+00 |
| updated_at | 2026-01-24 15:06:05.675366+00 |
| description | error boundary operator for rx_core. ensures at the type level that no errors are coming from upstream. |
| homepage | https://github.com/AlexAegis/rx_bevy |
| repository | https://github.com/AlexAegis/rx_bevy |
| max_upload_size | |
| id | 2054662 |
| size | 14,450 |
Enforce Never as the error type to guard pipelines at compile time.
Result values.Result values into next and error signals.cargo run -p rx_core --example operator_error_boundary_example
use rx_core::prelude::*;
/// The [IdentityOperator] does nothing. The only purpose it has
/// is to define inputs for a [CompositeOperator]: an [Operator] that made out
/// of other [Operator]s without having to use a [Pipe] which would require a
/// source [Observable]
fn main() {
let _s = (1..=5)
.into_observable()
.map(|i| i * 2)
.error_boundary()
.subscribe(PrintObserver::new("error_boundary_operator (composite)"));
// This cannot compile as relative to the `error_boundary` operator,
// upstreams error type is not `Never`
// let _s2 = throw("error".to_string())
// .map(|i| i)
// .error_boundary()
// .subscribe(PrintObserver::new("error_boundary_operator (composite)"));
let _s3 = throw("error".to_string())
.map(|i| i)
.into_result()
.error_boundary()
.subscribe(PrintObserver::new("error_boundary_operator (composite)"));
}
error_boundary_operator (composite) - next: 2
error_boundary_operator (composite) - next: 4
error_boundary_operator (composite) - next: 6
error_boundary_operator (composite) - next: 8
error_boundary_operator (composite) - next: 10
error_boundary_operator (composite) - completed
error_boundary_operator (composite) - unsubscribed
error_boundary_operator (composite) - next: Err("error")
error_boundary_operator (composite) - unsubscribed