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

observable_iterator

crates.io ci codecov license

This crate provides functionality to convert iterators into observables using the IntoIteratorObservableExt extension trait.

See Also

Features

  • Extension Trait: IntoIteratorObservableExt provides the into_observable() method for any type that implements IntoIterator + Clone
  • Universal Support: Works with ranges, vectors, arrays, and any other iterator type
  • No Conflicts: Uses an extension trait approach to avoid conflicts with the main IntoObservable trait

Usage

#![allow(unused)]
fn main() {
use rx_core::prelude::*;

// Convert ranges into observables
(1..=5).into_observable::<()>().subscribe(PrintObserver::new("range"));

// Convert vectors into observables
vec![1, 2, 3].into_observable::<()>().subscribe(PrintObserver::new("vector"));

// Convert arrays into observables
[10, 20, 30].into_observable::<()>().subscribe(PrintObserver::new("array"));
}

Examples

cargo run -p rx_core --example observable_iterator_into_example
cargo run -p rx_core --example observable_iterator_example