pub enum LocalOrSpawnedFuture<F, O> {
Local {
fut: F,
},
Spawned {
handle: AbortOnDropHandle<O>,
},
}Expand description
Represents a future that may either be local or spawned.
Variants§
Implementations§
Source§impl<F, O> LocalOrSpawnedFuture<F, O>where
F: Future<Output = O>,
impl<F, O> LocalOrSpawnedFuture<F, O>where
F: Future<Output = O>,
Source§impl<F, O> LocalOrSpawnedFuture<F, O>
impl<F, O> LocalOrSpawnedFuture<F, O>
Sourcepub fn spawn(task_priority: TaskPriority, fut: F) -> Self
pub fn spawn(task_priority: TaskPriority, fut: F) -> Self
Spawns the future onto the async executor.
Trait Implementations§
Source§impl<F, O> Future for LocalOrSpawnedFuture<F, O>where
F: Future<Output = O>,
impl<F, O> Future for LocalOrSpawnedFuture<F, O>where
F: Future<Output = O>,
impl<'__pin, F, O> Unpin for LocalOrSpawnedFuture<F, O>where
PinnedFieldsOf<__Origin<'__pin, F, O>>: Unpin,
Auto Trait Implementations§
impl<F, O> !RefUnwindSafe for LocalOrSpawnedFuture<F, O>
impl<F, O> !UnwindSafe for LocalOrSpawnedFuture<F, O>
impl<F, O> Freeze for LocalOrSpawnedFuture<F, O>where
F: Freeze,
impl<F, O> Send for LocalOrSpawnedFuture<F, O>where
F: Send,
impl<F, O> Sync for LocalOrSpawnedFuture<F, O>where
F: Sync,
impl<F, O> UnsafeUnpin for LocalOrSpawnedFuture<F, O>where
F: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 moreSource§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