#[non_exhaustive]pub enum Capacity {
Bounded(usize),
Unbounded,
}Expand description
Channel capacity policy.
#[non_exhaustive] so that adding new policies (e.g. bounded with an
overflow strategy) in a future release is not a breaking change.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Bounded(usize)
Bounded channel; producers apply backpressure when full.
Unbounded
Unbounded channel; producers never block, but producers can OOM the consumer if they vastly outpace it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Capacity
impl RefUnwindSafe for Capacity
impl Send for Capacity
impl Sync for Capacity
impl Unpin for Capacity
impl UnsafeUnpin for Capacity
impl UnwindSafe for Capacity
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