Struct zksync_concurrency::oneshot::Receiver
source · pub struct Receiver<T>(/* private fields */);
Expand description
Receiver end of the oneshot channel.
Implementations§
source§impl<T> Receiver<T>
impl<T> Receiver<T>
sourcepub async fn recv(self, ctx: &Ctx) -> OrCanceled<T>
pub async fn recv(self, ctx: &Ctx) -> OrCanceled<T>
Awaits for a message from the channel. Waits for cancelation if the channel has been disconnected.
sourcepub async fn recv_or_disconnected(
self,
ctx: &Ctx,
) -> OrCanceled<Result<T, Disconnected>>
pub async fn recv_or_disconnected( self, ctx: &Ctx, ) -> OrCanceled<Result<T, Disconnected>>
Awaits for a message from the channel. Returns an error if channel is empty and disconnected.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Receiver<T>
impl<T> !RefUnwindSafe for Receiver<T>
impl<T> Send for Receiver<T>where
T: Send,
impl<T> Sync for Receiver<T>where
T: Send,
impl<T> Unpin for Receiver<T>
impl<T> !UnwindSafe for Receiver<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