Enum ntex_util::future::Either [−][src]
Combines two different futures, streams, or sinks having the same associated types into a single type.
Variants
First branch of the type
Second branch of the type
Implementations
impl<A, B> Either<A, B>
[src]
pub fn is_left(&self) -> bool
[src]
Return true if the value is the Left
variant.
pub fn is_right(&self) -> bool
[src]
Return true if the value is the Right
variant.
pub fn left(self) -> Option<A>
[src]
Convert the left side of Either<L, R>
to an Option<L>
.
pub fn right(self) -> Option<B>
[src]
Convert the right side of Either<L, R>
to an Option<R>
.
pub fn as_ref(&self) -> Either<&A, &B>ⓘ
[src]
Convert &Either<L, R>
to Either<&L, &R>
.
pub fn as_mut(&mut self) -> Either<&mut A, &mut B>ⓘ
[src]
Convert &mut Either<L, R>
to Either<&mut L, &mut R>
.
impl<A, B, T> Either<(T, A), (T, B)>
[src]
pub fn factor_first(self) -> (T, Either<A, B>)
[src]
Factor out a homogeneous type from an either of pairs.
Here, the homogeneous type is the first element of the pairs.
impl<A, B, T> Either<(A, T), (B, T)>
[src]
pub fn factor_second(self) -> (Either<A, B>, T)
[src]
Factor out a homogeneous type from an either of pairs.
Here, the homogeneous type is the second element of the pairs.
impl<T> Either<T, T>
[src]
pub fn into_inner(self) -> T
[src]
Extract the value of an either over two equivalent types.
Trait Implementations
impl<A: Clone, B: Clone> Clone for Either<A, B>
[src]
impl<A: Copy, B: Copy> Copy for Either<A, B>
[src]
impl<A: Debug, B: Debug> Debug for Either<A, B>
[src]
impl<A, B> Display for Either<A, B> where
A: Display,
B: Display,
[src]
A: Display,
B: Display,
impl<A: Eq, B: Eq> Eq for Either<A, B>
[src]
impl<A, B> Error for Either<A, B> where
A: Error,
B: Error,
[src]
A: Error,
B: Error,
Either
implements Error
if both A
and B
implement it.
pub fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
pub fn backtrace(&self) -> Option<&Backtrace>
[src]
pub fn description(&self) -> &str
1.0.0[src]
pub fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl<A, B> Future for Either<A, B> where
A: Future,
B: Future<Output = A::Output>,
[src]
A: Future,
B: Future<Output = A::Output>,
type Output = A::Output
The type of value produced on completion.
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>
[src]
impl<A: Hash, B: Hash> Hash for Either<A, B>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<A: Ord, B: Ord> Ord for Either<A, B>
[src]
fn cmp(&self, other: &Either<A, B>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<A: PartialEq, B: PartialEq> PartialEq<Either<A, B>> for Either<A, B>
[src]
impl<A: PartialOrd, B: PartialOrd> PartialOrd<Either<A, B>> for Either<A, B>
[src]
fn partial_cmp(&self, other: &Either<A, B>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<A, B> StructuralEq for Either<A, B>
[src]
impl<A, B> StructuralPartialEq for Either<A, B>
[src]
Auto Trait Implementations
impl<A, B> RefUnwindSafe for Either<A, B> where
A: RefUnwindSafe,
B: RefUnwindSafe,
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Send for Either<A, B> where
A: Send,
B: Send,
A: Send,
B: Send,
impl<A, B> Sync for Either<A, B> where
A: Sync,
B: Sync,
A: Sync,
B: Sync,
impl<A, B> Unpin for Either<A, B> where
A: Unpin,
B: Unpin,
A: Unpin,
B: Unpin,
impl<A, B> UnwindSafe for Either<A, B> where
A: UnwindSafe,
B: UnwindSafe,
A: UnwindSafe,
B: 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
into_future
)The output that the future will produce on completion.
type Future = F
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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<F, T, E> TryFuture for F where
F: Future<Output = Result<T, E>> + ?Sized,
[src]
F: Future<Output = Result<T, E>> + ?Sized,
type Ok = T
The type of successful values yielded by this future
type Error = E
The type of failures yielded by this future
pub fn try_poll(
self: Pin<&mut F>,
cx: &mut Context<'_>
) -> Poll<<F as Future>::Output>
[src]
self: Pin<&mut F>,
cx: &mut Context<'_>
) -> Poll<<F as Future>::Output>
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,