pub enum MaybeAsync<T, F: Future<Output = T>> {
Sync(T),
Async(F),
}Variants§
Implementations§
Source§impl<T, F: Future<Output = T>> MaybeAsync<T, F>
impl<T, F: Future<Output = T>> MaybeAsync<T, F>
pub fn into_future(self) -> Either<Ready<T>, F> ⓘ
pub fn map<U, Func>(self, func: Func) -> MaybeAsync<U, MapFuture<F, Func>>where
Func: FnOnce(T) -> U,
Source§impl<T, InnerF, OuterF> MaybeAsync<MaybeAsync<T, InnerF>, OuterF>
impl<T, InnerF, OuterF> MaybeAsync<MaybeAsync<T, InnerF>, OuterF>
pub fn flatten(self) -> MaybeAsync<T, FlattenFuture<OuterF, InnerF, T>>
Auto Trait Implementations§
impl<T, F> Freeze for MaybeAsync<T, F>
impl<T, F> RefUnwindSafe for MaybeAsync<T, F>where
T: RefUnwindSafe,
F: RefUnwindSafe,
impl<T, F> Send for MaybeAsync<T, F>
impl<T, F> Sync for MaybeAsync<T, F>
impl<T, F> Unpin for MaybeAsync<T, F>
impl<T, F> UnsafeUnpin for MaybeAsync<T, F>where
T: UnsafeUnpin,
F: UnsafeUnpin,
impl<T, F> UnwindSafe for MaybeAsync<T, F>where
T: UnwindSafe,
F: UnwindSafe,
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> 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