pub struct WaitCtx<T, S, E>(/* private fields */);
Expand description
End-point used to wait for a value to be sent from the paired
SetCtx
.
Implementations§
source§impl<T, S, E> WaitCtx<T, S, E>
impl<T, S, E> WaitCtx<T, S, E>
sourcepub fn wait(self) -> Result<T, Error<S, E>>
pub fn wait(self) -> Result<T, Error<S, E>>
Wait for the paired SetCtx
to set a value or fail.
§Errors
Returns application-specific error wrapped in an Error::App
if the
SetCtx
reported failure.
sourcepub fn try_get(&self) -> Result<Option<T>, Error<S, E>>
pub fn try_get(&self) -> Result<Option<T>, Error<S, E>>
Non-blocking attempt to get the get the stored value.
Returns Ok(Some(T))
if a value has been stored. Returns Ok(None)
if
no value has been stored.
§Errors
Returns application-specific error wrapped in an Error::App
if the
SetCtx
reported failure.
§Panics
This function will panic if called again after it has resolved to either data or error.
sourcepub const fn wait_async(&self) -> WaitFuture<'_, T, S, E> ⓘ
pub const fn wait_async(&self) -> WaitFuture<'_, T, S, E> ⓘ
Trait Implementations§
Auto Trait Implementations§
impl<T, S, E> Freeze for WaitCtx<T, S, E>
impl<T, S, E> !RefUnwindSafe for WaitCtx<T, S, E>
impl<T, S, E> Send for WaitCtx<T, S, E>
impl<T, S, E> Sync for WaitCtx<T, S, E>
impl<T, S, E> Unpin for WaitCtx<T, S, E>
impl<T, S, E> !UnwindSafe for WaitCtx<T, S, E>
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
source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
source§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more