pub enum BackpressurePolicy<T>{
BlockOnFull,
DropLatestIf(Option<Box<dyn Fn(&T) -> bool + Send + Sync>>),
DropOldestIf(Option<Box<dyn Fn(&T) -> bool + Send + Sync>>),
}Expand description
the Backpressure policy
Variants§
BlockOnFull
Block the sender when the queue is full
DropLatestIf(Option<Box<dyn Fn(&T) -> bool + Send + Sync>>)
Drop items based on predicate when the queue is full, it drops from the newest to the oldest With this policy, [send] method can be Err when all items are not droppable Predicate is only applied to ActionOp::Action variants, other variants are never dropped
DropOldestIf(Option<Box<dyn Fn(&T) -> bool + Send + Sync>>)
Drop items based on predicate when the queue is full, it drops from the oldest to the newest With this policy, [send] method can be Err when all items are not droppable Predicate is only applied to ActionOp::Action variants, other variants are never dropped
Trait Implementations§
Auto 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