pub struct ControlledFuture<T: Unpin> { /* private fields */ }
Expand description
A Future
that will resolve either immediately, or in the future.
Will not resolve unless it has been explicitly completed, either
by constructing it with ControlledFuture::new_completed
, or using FutureClicker::complete
.
Implementations§
Source§impl<T: Unpin + Send + 'static> ControlledFuture<T>
impl<T: Unpin + Send + 'static> ControlledFuture<T>
Sourcepub fn new() -> (Self, FutureClicker<T>)
pub fn new() -> (Self, FutureClicker<T>)
Construct a ControlledFuture
that will resolve once the returned
FutureClicker
is used to set a value.
Sourcepub fn new_completed(value: T) -> Self
pub fn new_completed(value: T) -> Self
Construct a ControlledFuture
that will resolve immediately to the
given value.
No FutureClicker
is returned as the ControlledFuture
is already complete.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ControlledFuture<T>
impl<T> !RefUnwindSafe for ControlledFuture<T>
impl<T> Send for ControlledFuture<T>where
T: Send,
impl<T> Sync for ControlledFuture<T>where
T: Send,
impl<T> Unpin for ControlledFuture<T>
impl<T> !UnwindSafe for ControlledFuture<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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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