pub struct AnyOf<'s, C: ?Sized + Config, P: Pickable<C>> { /* private fields */ }Expand description
A combinator for awaiting the first future to complete.
This utility resolves when the first future in its collection completes, returning that future’s result.
§Behavior
- If multiple futures terminate simultaneously, the one appearing first in the code will take precedence.
- Supports chaining with the
ormethod to combine futures.
Implementations§
Trait Implementations§
impl<'pin, 's, C: ?Sized + Config, P: Pickable<C>> Unpin for AnyOf<'s, C, P>where
PinnedFieldsOf<__AnyOf<'pin, 's, C, P>>: Unpin,
Auto Trait Implementations§
impl<'s, C, P> Freeze for AnyOf<'s, C, P>
impl<'s, C, P> !RefUnwindSafe for AnyOf<'s, C, P>
impl<'s, C, P> !Send for AnyOf<'s, C, P>
impl<'s, C, P> !Sync for AnyOf<'s, C, P>
impl<'s, C, P> !UnwindSafe for AnyOf<'s, C, P>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more