| Crates.io | rx_core_operator_element_at |
| lib.rs | rx_core_operator_element_at |
| version | 0.2.0 |
| created_at | 2026-01-20 01:38:38.882137+00 |
| updated_at | 2026-01-24 15:05:44.232336+00 |
| description | element_at operator for rx_core; Emit the value at the given index then complete. |
| homepage | https://github.com/AlexAegis/rx_bevy |
| repository | https://github.com/AlexAegis/rx_bevy |
| max_upload_size | |
| id | 2055630 |
| size | 19,142 |
Emit the value at the given index then complete.
If the element at the specified index does not exist, because it had completed before reaching that index, the operator will either error with [ElementAtOperatorError::IndexOutOfRange] or emit a default value if one was provided.
cargo run -p rx_core --example operator_element_at_example
let _subscription = vec!["a", "b", "c", "d", "e"]
.into_observable()
.element_at(2)
.subscribe(PrintObserver::new("element_at_operator"));
Output:
element_at_operator - next: "c"
element_at_operator - completed
element_at_operator - unsubscribed