rx_core_operator_element_at

Crates.iorx_core_operator_element_at
lib.rsrx_core_operator_element_at
version0.2.0
created_at2026-01-20 01:38:38.882137+00
updated_at2026-01-24 15:05:44.232336+00
descriptionelement_at operator for rx_core; Emit the value at the given index then complete.
homepagehttps://github.com/AlexAegis/rx_bevy
repositoryhttps://github.com/AlexAegis/rx_bevy
max_upload_size
id2055630
size19,142
Sandor (AlexAegis)

documentation

https://github.com/AlexAegis/rx_bevy

README

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
Commit count: 652

cargo fmt