[−][src]Function futures_micro::prelude::or
pub fn or<F1, F2>(future1: F1, future2: F2) -> Or<F1, F2>ⓘ where
F1: Future,
F2: Future,
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(ready(1), pending::<i32>()).await, 1); assert_eq!(or(pending::<i32>(), ready(2)).await, 2); // The first future wins. assert_eq!(or(ready(1), ready(2)).await, 1);