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<SyncOkValue, E, F> MaybeAsync<Result<SyncOkValue, E>, F>
impl<SyncOkValue, E, F> MaybeAsync<Result<SyncOkValue, E>, F>
pub fn into_error_future(self) -> Either<Ready<Option<E>>, ErrOptionFuture<F>> ⓘ
pub fn into_result(self) -> Either<Ready<Result<SyncOkValue, E>>, F> ⓘwhere
SyncOkValue: Into<SyncOkValue>,
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> Forget for MaybeAsync<T, F>
impl<T, F> Freeze for MaybeAsync<T, F>
impl<T, F> Move 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 moreSource§impl<T, U> TypeSubset<U> for Twhere
U: TypeSuperset<T>,
impl<T, U> TypeSubset<U> for Twhere
U: TypeSuperset<T>,
Source§fn is_subset_of(&self, other: &U) -> bool
fn is_subset_of(&self, other: &U) -> bool
Returns whether self is a subset of type