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_enumerate

crates.io ci codecov license

Attach a running index to each emission.

See Also

Example

cargo run -p rx_core --example operator_enumerate_example
let _subscription = (10..=15)
    .into_observable()
    .enumerate()
    .subscribe(PrintObserver::new("enumerate_operator"));

Output:

enumerate_operator - next: (10, 0)
enumerate_operator - next: (11, 1)
enumerate_operator - next: (12, 2)
enumerate_operator - next: (13, 3)
enumerate_operator - next: (14, 4)
enumerate_operator - next: (15, 5)
enumerate_operator - completed
enumerate_operator - unsubscribed