#rx-core-operator #rx-bevy-operator #rx-core #rx #rx-bevy

rx_core_operator_element_at

element_at operator for rx_core; Emit the value at the given index then complete

5 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.1.1 Jan 23, 2026
0.1.0 Jan 20, 2026

#2554 in Game dev


Used in 2 crates (via rx_core)

MIT license

170KB
4.5K SLoC

operator_element_at

crates.io ci codecov license

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.

See Also

Example

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

Dependencies

~275–750KB
~18K SLoC