pub struct Slot<T> { /* private fields */ }Expand description
One-item ownership handoff between tasks (sockets, streams, anything non-Clone).
Slot::put stores a value. If the slot was already full, the previous value is
dropped (no queue). Slot::take waits until a value is available.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Slot<T>
impl<T> RefUnwindSafe for Slot<T>
impl<T> Send for Slot<T>where
T: Send,
impl<T> Sync for Slot<T>where
T: Send,
impl<T> Unpin for Slot<T>
impl<T> UnsafeUnpin for Slot<T>
impl<T> UnwindSafe for Slot<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