pub struct Permit<'q, T> { /* private fields */ }
Expand description
A “permit” giving its holder the right to push one element into a queue, without waiting.
This is produced by Push::try_reserve
/Push::reserve
when they find
space available in the queue. The key property here is that producing a
Permit
does not, by itself, change the queue state – you can turn around
and Drop
the Permit
without losing data or pushing anything. This makes
cancel safety much easier to reason about.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'q, T> RefUnwindSafe for Permit<'q, T>where T: RefUnwindSafe,
impl<'q, T> Send for Permit<'q, T>where T: Send,
impl<'q, T> Sync for Permit<'q, T>where T: Sync,
impl<'q, T> Unpin for Permit<'q, T>
impl<'q, T> !UnwindSafe for Permit<'q, 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