6 releases
Uses new Rust 2024
| new 0.2.1 | Feb 1, 2026 |
|---|---|
| 0.2.0 | Jan 24, 2026 |
| 0.1.2 | Jan 24, 2026 |
| 0.0.1 | Jan 19, 2026 |
#35 in #rx-core-operator
Used in 2 crates
(via rx_core)
165KB
4.5K
SLoC
operator_first
Emit only the first value, then complete.
See Also
- TakeOperator -
Emit only the first
nvalues, then complete. - FindOperator - Emit the first value that matches a predicate.
- ElementAtOperator - Emit the value at the given index then complete.
- FindIndexOperator - Emit the index of the first value that matches a predicate.
Example
cargo run -p rx_core --example operator_first_example
let _subscription = (1..=5)
.into_observable()
.first()
.subscribe(PrintObserver::new("first_operator"));
Output:
first_operator - next: 1
first_operator - completed
first_operator - unsubscribed
Dependencies
~275–750KB
~18K SLoC