pub enum BackpressurePolicy<T>{
BlockOnFull,
DropOldest,
DropLatest,
DropLatestIf {
predicate: Arc<dyn Fn(&ActionOp<T>) -> bool + Send + Sync>,
},
DropOldestIf {
predicate: Arc<dyn Fn(&ActionOp<T>) -> bool + Send + Sync>,
},
}Expand description
the Backpressure policy
Variants§
BlockOnFull
Block the sender when the queue is full
DropOldest
Drop the oldest item when the queue is full
DropLatest
Drop the latest item when the queue is full
DropLatestIf
Drop items based on predicate when the queue is full
DropOldestIf
Drop items based on predicate when the queue is full
Trait Implementations§
Source§impl<T> Clone for BackpressurePolicy<T>
impl<T> Clone for BackpressurePolicy<T>
Source§fn clone(&self) -> BackpressurePolicy<T>
fn clone(&self) -> BackpressurePolicy<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for BackpressurePolicy<T>
impl<T> !RefUnwindSafe for BackpressurePolicy<T>
impl<T> Send for BackpressurePolicy<T>
impl<T> Sync for BackpressurePolicy<T>
impl<T> Unpin for BackpressurePolicy<T>
impl<T> !UnwindSafe for BackpressurePolicy<T>
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