Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

operator_find_index

crates.io ci codecov license

Emit the index of the first value that matches a predicate.

See Also

Example

cargo run -p rx_core --example operator_find_index_example
let _subscription = (1..=5)
    .into_observable()
    .find_index(|i| i % 2 == 0)
    .subscribe(PrintObserver::new("find_index_operator"));

Output:

find_index_operator - next: 1
find_index_operator - completed
find_index_operator - unsubscribed