pub struct Bounded<T> { /* private fields */ }Expand description
Keeps at most capacity items, in order, and applies an Overflow rule beyond that. This
is onBackpressureBuffer with a capacity of other ReactiveX stacks.
The capacity is a NonZeroUsize: a buffer that holds nothing would yield nothing.
Latest is Bounded::drop_oldest with a capacity of one.
Implementations§
Source§impl<T> Bounded<T>
impl<T> Bounded<T>
Sourcepub fn new(capacity: NonZeroUsize, overflow: Overflow) -> Self
pub fn new(capacity: NonZeroUsize, overflow: Overflow) -> Self
Keeps at most capacity items and applies overflow beyond that.
Sourcepub fn drop_oldest(capacity: NonZeroUsize) -> Self
pub fn drop_oldest(capacity: NonZeroUsize) -> Self
Keeps the newest capacity items; see Overflow::DropOldest.
Sourcepub fn drop_newest(capacity: NonZeroUsize) -> Self
pub fn drop_newest(capacity: NonZeroUsize) -> Self
Keeps the oldest capacity items; see Overflow::DropNewest.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Bounded<T>
impl<T> RefUnwindSafe for Bounded<T>where
VecDeque<T>: RefUnwindSafe,
impl<T> Send for Bounded<T>
impl<T> Sync for Bounded<T>
impl<T> Unpin for Bounded<T>
impl<T> UnsafeUnpin for Bounded<T>where
VecDeque<T>: UnsafeUnpin,
impl<T> UnwindSafe for Bounded<T>where
VecDeque<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