pub struct FutureTask<D, F> { /* private fields */ }Implementations§
Source§impl<D: 'static, F: Future<Output = D> + 'static> FutureTask<D, F>
impl<D: 'static, F: Future<Output = D> + 'static> FutureTask<D, F>
Sourcepub fn create(future: impl FnMut() -> F + 'static) -> FutureTask<D, F>
pub fn create(future: impl FnMut() -> F + 'static) -> FutureTask<D, F>
Create a FutureTask with the given callback.
Sourcepub fn start(&mut self)
pub fn start(&mut self)
Start the FutureTask. If it was running already then it will be restarted.
Sourcepub fn state(&self) -> ReadRef<'static, FutureState<D>>
pub fn state(&self) -> ReadRef<'static, FutureState<D>>
Read the state of the FutureTask. See FutureState.
Trait Implementations§
Source§impl<D, F> Clone for FutureTask<D, F>
impl<D, F> Clone for FutureTask<D, F>
impl<D, F> Copy for FutureTask<D, F>
Auto Trait Implementations§
impl<D, F> Freeze for FutureTask<D, F>
impl<D, F> !RefUnwindSafe for FutureTask<D, F>
impl<D, F> !Send for FutureTask<D, F>
impl<D, F> !Sync for FutureTask<D, F>
impl<D, F> Unpin for FutureTask<D, F>where
D: Unpin,
impl<D, F> !UnwindSafe for FutureTask<D, F>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more