pub struct OneshotChannel<T>(/* private fields */);
Expand description
An unsynchronized (!Sync
), asynchronous oneshot channel.
This is useful for asynchronously handing a single value from one future to another.
Implementations§
Source§impl<T> OneshotChannel<T>
impl<T> OneshotChannel<T>
Sourcepub fn split(&mut self) -> (SenderRef<'_, T>, ReceiverRef<'_, T>)
pub fn split(&mut self) -> (SenderRef<'_, T>, ReceiverRef<'_, T>)
Splits the channel into borrowing SenderRef
and ReceiverRef
handles.
Auto Trait Implementations§
impl<T> !Freeze for OneshotChannel<T>
impl<T> !RefUnwindSafe for OneshotChannel<T>
impl<T> Send for OneshotChannel<T>where
T: Send,
impl<T> !Sync for OneshotChannel<T>
impl<T> Unpin for OneshotChannel<T>where
T: Unpin,
impl<T> UnwindSafe for OneshotChannel<T>where
T: UnwindSafe,
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