Enum actix_utils::future::Either [−][src]
pub enum Either<L, R> {
Left {
value: L,
},
Right {
value: R,
},
}Combines two different futures that have the same output type.
Construct variants with Either::left and Either::right.
Examples
use actix_utils::future::{ready, Ready, Either}; let res = Either::<_, Ready<usize>>::left(ready(42)); assert_eq!(res.await, 42); let res = Either::<Ready<usize>, _>::right(ready(43)); assert_eq!(res.await, 43);
Variants
A value of type L.
A value of type R.
Implementations
impl<L, R> Either<L, R>[src]
pub fn left(value: L) -> Either<L, R>ⓘ[src]
Creates new Either using left variant.
pub fn right(value: R) -> Either<L, R>ⓘ[src]
Creates new Either using right variant.
impl<T> Either<T, T>[src]
pub fn into_inner(self) -> T[src]
Unwraps into inner value when left and right have a common type.
Trait Implementations
impl<L: Clone, R: Clone> Clone for Either<L, R>[src]
impl<L: Debug, R: Debug> Debug for Either<L, R>[src]
impl<L, R> Future for Either<L, R> where
L: Future,
R: Future<Output = L::Output>, [src]
L: Future,
R: Future<Output = L::Output>,
type Output = L::Output
The type of value produced on completion.
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>[src]
impl<'__pin, L, R> Unpin for Either<L, R> where
__Origin<'__pin, L, R>: Unpin, [src]
__Origin<'__pin, L, R>: Unpin,
Auto Trait Implementations
impl<L, R> RefUnwindSafe for Either<L, R> where
L: RefUnwindSafe,
R: RefUnwindSafe,
L: RefUnwindSafe,
R: RefUnwindSafe,
impl<L, R> Send for Either<L, R> where
L: Send,
R: Send,
L: Send,
R: Send,
impl<L, R> Sync for Either<L, R> where
L: Sync,
R: Sync,
L: Sync,
R: Sync,
impl<L, R> UnwindSafe for Either<L, R> where
L: UnwindSafe,
R: UnwindSafe,
L: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<F> IntoFuture for F where
F: Future, [src]
F: Future,
type Output = <F as Future>::Output
🔬 This is a nightly-only experimental API. (
into_future)The output that the future will produce on completion.
type Future = F
🔬 This is a nightly-only experimental API. (
into_future)Which kind of future are we turning this into?
pub fn into_future(self) -> <F as IntoFuture>::Future[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,