Enum actix_utils::future::Either [−][src]
pub enum Either<L, R> {
Left {
value: L,
},
Right {
value: R,
},
}Expand description
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
Left
A value of type L.
Right
A value of type R.
Implementations
Creates new Either using left variant.
Unwraps into inner value when left and right have a common type.
Trait Implementations
Auto Trait Implementations
impl<L, R> RefUnwindSafe for Either<L, R> where
L: RefUnwindSafe,
R: RefUnwindSafe,
impl<L, R> UnwindSafe for Either<L, R> where
L: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (
into_future)The output that the future will produce on completion.
type Future = F
type Future = F
🔬 This is a nightly-only experimental API. (
into_future)Which kind of future are we turning this into?
🔬 This is a nightly-only experimental API. (
into_future)Creates a future from a value.
