observable_iterator
This crate provides functionality to convert iterators into observables using the IntoIteratorObservableExt extension trait.
See Also
- IteratorOnTickObservable - Emits iterator items one per scheduler tick.
Features
- Extension Trait:
IntoIteratorObservableExtprovides theinto_observable()method for any type that implementsIntoIterator + 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
IntoObservabletrait
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