[−][src]Trait rxrust::ops::take::Take
Emits only the first count
values emitted by the source Observable.
take
returns an Observable that emits only the first count
values
emitted by the source Observable. If the source emits fewer than count
values then all of its values are emitted. After that, it completes,
regardless if the source completes.
Example
Take the first 5 seconds of an infinite 1-second interval Observable
ops::{Take}, prelude::*, }; observable::from_range(0..10).take(5).subscribe(|v| println!("{}", v)); // print logs: // 0 // 1 // 2 // 3 // 4
Provided methods
Loading content...Implementors
impl<'a, O> Take for O where
O: RawSubscribable,
[src]
O: RawSubscribable,