Function rxrust::observable::from_iter
source · [−]pub fn from_iter<Iter>(iter: Iter) -> ObservableIter<Iter> where
Iter: IntoIterator,
Expand description
Creates an observable that produces values from an iterator.
Completes when all elements have been emitted. Never emits an error.
Arguments
iter
- An iterator to get all the values from.
Examples
A simple example for a range:
use rxrust::prelude::*;
observable::from_iter(0..10)
.subscribe(|v| {println!("{},", v)});
Or with a vector:
use rxrust::prelude::*;
observable::from_iter(vec![0,1,2,3])
.subscribe(|v| {println!("{},", v)});