[−][src]Struct ufut::Or
Returns the result of left
or right
future, preferring left
if both are ready.
Implementations
impl<F1, F2> Or<F1, F2> where
F1: Future,
F2: Future,
[src]
F1: Future,
F2: Future,
pub fn new(future1: F1, future2: F2) -> Or<F1, F2>ⓘ
[src]
Returns the result of left
or right
future, preferring left
if both are ready.
Examples
use futures_micro::prelude::{Or, pending, ready}; assert_eq!(Or::new(ready(1), pending::<i32>()).await, 1); assert_eq!(Or::new(pending::<i32>(), ready(2)).await, 2); // The first future wins. assert_eq!(Or::new(ready(1), ready(2)).await, 1);
Trait Implementations
impl<F1, F2> Debug for Or<F1, F2> where
F1: Debug,
F2: Debug,
[src]
F1: Debug,
F2: Debug,
impl<T, F1, F2> Future for Or<F1, F2> where
F1: Future<Output = T>,
F2: Future<Output = T>,
[src]
F1: Future<Output = T>,
F2: Future<Output = T>,
Auto Trait Implementations
impl<F1, F2> RefUnwindSafe for Or<F1, F2> where
F1: RefUnwindSafe,
F2: RefUnwindSafe,
F1: RefUnwindSafe,
F2: RefUnwindSafe,
impl<F1, F2> Send for Or<F1, F2> where
F1: Send,
F2: Send,
F1: Send,
F2: Send,
impl<F1, F2> Sync for Or<F1, F2> where
F1: Sync,
F2: Sync,
F1: Sync,
F2: Sync,
impl<F1, F2> Unpin for Or<F1, F2> where
F1: Unpin,
F2: Unpin,
F1: Unpin,
F2: Unpin,
impl<F1, F2> UnwindSafe for Or<F1, F2> where
F1: UnwindSafe,
F2: UnwindSafe,
F1: UnwindSafe,
F2: 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,
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<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.
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>,