pub struct Latest<T>(/* private fields */);Expand description
Keeps only the newest item: each item the source pushes replaces the one waiting to be
polled. This is onBackpressureLatest of other ReactiveX stacks.
The memory cost is one item whatever the pace of the source, at the price of skipping the items the consumer was too slow to see — right for a stream of states, where only the current one matters, and wrong for a stream of events.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Latest<T>
impl<T> RefUnwindSafe for Latest<T>where
Option<T>: RefUnwindSafe,
impl<T> Send for Latest<T>
impl<T> Sync for Latest<T>
impl<T> Unpin for Latest<T>
impl<T> UnsafeUnpin for Latest<T>where
Option<T>: UnsafeUnpin,
impl<T> UnwindSafe for Latest<T>where
Option<T>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more