pub struct AvailableTask<F: Future + 'static> { /* private fields */ }
Expand description
An uninitialized TaskStorage
.
Implementations§
Source§impl<F: Future + 'static> AvailableTask<F>
impl<F: Future + 'static> AvailableTask<F>
Sourcepub fn claim(task: &'static TaskStorage<F>) -> Option<Self>
pub fn claim(task: &'static TaskStorage<F>) -> Option<Self>
Try to claim a TaskStorage
.
This function returns None
if a task has already been spawned and has not finished running.
Sourcepub fn initialize(self, future: impl FnOnce() -> F) -> SpawnToken<F>
pub fn initialize(self, future: impl FnOnce() -> F) -> SpawnToken<F>
Initialize the TaskStorage
to run the given future.
Auto Trait Implementations§
impl<F> Freeze for AvailableTask<F>
impl<F> !RefUnwindSafe for AvailableTask<F>
impl<F> Send for AvailableTask<F>
impl<F> Sync for AvailableTask<F>
impl<F> Unpin for AvailableTask<F>
impl<F> !UnwindSafe for AvailableTask<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