Skip to main content

Branches

Trait Branches 

Source
pub trait Branches: Sealed {
    type Output;

    // Required methods
    fn poll_all(&mut self, start: f64, cx: &mut Context<'_>) -> Option<f64>;
    fn poll_any(
        &mut self,
        start: f64,
        cx: &mut Context<'_>,
    ) -> Option<(usize, f64)>;
    fn take(&mut self) -> Self::Output;
}
Expand description

Branches run by all and any. Implemented by the crate only.

Required Associated Types§

Source

type Output

Outputs of all branches.

Required Methods§

Source

fn poll_all(&mut self, start: f64, cx: &mut Context<'_>) -> Option<f64>

Polls unfinished branches; returns the max end time once all are done.

Source

fn poll_any(&mut self, start: f64, cx: &mut Context<'_>) -> Option<(usize, f64)>

Polls all branches; returns (index, end time) of the first finished.

Source

fn take(&mut self) -> Self::Output

Outputs, once all are done.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<A: Future, B: Future, C: Future, D: Future, E: Future, F: Future, G: Future, H: Future, I: Future, J: Future, K: Future, L: Future> Branches for (Branch<A>, Branch<B>, Branch<C>, Branch<D>, Branch<E>, Branch<F>, Branch<G>, Branch<H>, Branch<I>, Branch<J>, Branch<K>, Branch<L>)

Source§

type Output = (<A as Future>::Output, <B as Future>::Output, <C as Future>::Output, <D as Future>::Output, <E as Future>::Output, <F as Future>::Output, <G as Future>::Output, <H as Future>::Output, <I as Future>::Output, <J as Future>::Output, <K as Future>::Output, <L as Future>::Output)

Source§

fn poll_all(&mut self, start: f64, cx: &mut Context<'_>) -> Option<f64>

Source§

fn poll_any(&mut self, start: f64, cx: &mut Context<'_>) -> Option<(usize, f64)>

Source§

fn take(&mut self) -> Self::Output

Source§

impl<A: Future, B: Future, C: Future, D: Future, E: Future, F: Future, G: Future, H: Future, I: Future, J: Future, K: Future> Branches for (Branch<A>, Branch<B>, Branch<C>, Branch<D>, Branch<E>, Branch<F>, Branch<G>, Branch<H>, Branch<I>, Branch<J>, Branch<K>)

Source§

type Output = (<A as Future>::Output, <B as Future>::Output, <C as Future>::Output, <D as Future>::Output, <E as Future>::Output, <F as Future>::Output, <G as Future>::Output, <H as Future>::Output, <I as Future>::Output, <J as Future>::Output, <K as Future>::Output)

Source§

fn poll_all(&mut self, start: f64, cx: &mut Context<'_>) -> Option<f64>

Source§

fn poll_any(&mut self, start: f64, cx: &mut Context<'_>) -> Option<(usize, f64)>

Source§

fn take(&mut self) -> Self::Output

Source§

impl<A: Future, B: Future, C: Future, D: Future, E: Future, F: Future, G: Future, H: Future, I: Future, J: Future> Branches for (Branch<A>, Branch<B>, Branch<C>, Branch<D>, Branch<E>, Branch<F>, Branch<G>, Branch<H>, Branch<I>, Branch<J>)

Source§

type Output = (<A as Future>::Output, <B as Future>::Output, <C as Future>::Output, <D as Future>::Output, <E as Future>::Output, <F as Future>::Output, <G as Future>::Output, <H as Future>::Output, <I as Future>::Output, <J as Future>::Output)

Source§

fn poll_all(&mut self, start: f64, cx: &mut Context<'_>) -> Option<f64>

Source§

fn poll_any(&mut self, start: f64, cx: &mut Context<'_>) -> Option<(usize, f64)>

Source§

fn take(&mut self) -> Self::Output

Source§

impl<A: Future, B: Future, C: Future, D: Future, E: Future, F: Future, G: Future, H: Future, I: Future> Branches for (Branch<A>, Branch<B>, Branch<C>, Branch<D>, Branch<E>, Branch<F>, Branch<G>, Branch<H>, Branch<I>)

Source§

type Output = (<A as Future>::Output, <B as Future>::Output, <C as Future>::Output, <D as Future>::Output, <E as Future>::Output, <F as Future>::Output, <G as Future>::Output, <H as Future>::Output, <I as Future>::Output)

Source§

fn poll_all(&mut self, start: f64, cx: &mut Context<'_>) -> Option<f64>

Source§

fn poll_any(&mut self, start: f64, cx: &mut Context<'_>) -> Option<(usize, f64)>

Source§

fn take(&mut self) -> Self::Output

Source§

impl<A: Future, B: Future, C: Future, D: Future, E: Future, F: Future, G: Future, H: Future> Branches for (Branch<A>, Branch<B>, Branch<C>, Branch<D>, Branch<E>, Branch<F>, Branch<G>, Branch<H>)

Source§

type Output = (<A as Future>::Output, <B as Future>::Output, <C as Future>::Output, <D as Future>::Output, <E as Future>::Output, <F as Future>::Output, <G as Future>::Output, <H as Future>::Output)

Source§

fn poll_all(&mut self, start: f64, cx: &mut Context<'_>) -> Option<f64>

Source§

fn poll_any(&mut self, start: f64, cx: &mut Context<'_>) -> Option<(usize, f64)>

Source§

fn take(&mut self) -> Self::Output

Source§

impl<A: Future, B: Future, C: Future, D: Future, E: Future, F: Future, G: Future> Branches for (Branch<A>, Branch<B>, Branch<C>, Branch<D>, Branch<E>, Branch<F>, Branch<G>)

Source§

type Output = (<A as Future>::Output, <B as Future>::Output, <C as Future>::Output, <D as Future>::Output, <E as Future>::Output, <F as Future>::Output, <G as Future>::Output)

Source§

fn poll_all(&mut self, start: f64, cx: &mut Context<'_>) -> Option<f64>

Source§

fn poll_any(&mut self, start: f64, cx: &mut Context<'_>) -> Option<(usize, f64)>

Source§

fn take(&mut self) -> Self::Output

Source§

impl<A: Future, B: Future, C: Future, D: Future, E: Future, F: Future> Branches for (Branch<A>, Branch<B>, Branch<C>, Branch<D>, Branch<E>, Branch<F>)

Source§

type Output = (<A as Future>::Output, <B as Future>::Output, <C as Future>::Output, <D as Future>::Output, <E as Future>::Output, <F as Future>::Output)

Source§

fn poll_all(&mut self, start: f64, cx: &mut Context<'_>) -> Option<f64>

Source§

fn poll_any(&mut self, start: f64, cx: &mut Context<'_>) -> Option<(usize, f64)>

Source§

fn take(&mut self) -> Self::Output

Source§

impl<A: Future, B: Future, C: Future, D: Future, E: Future> Branches for (Branch<A>, Branch<B>, Branch<C>, Branch<D>, Branch<E>)

Source§

type Output = (<A as Future>::Output, <B as Future>::Output, <C as Future>::Output, <D as Future>::Output, <E as Future>::Output)

Source§

fn poll_all(&mut self, start: f64, cx: &mut Context<'_>) -> Option<f64>

Source§

fn poll_any(&mut self, start: f64, cx: &mut Context<'_>) -> Option<(usize, f64)>

Source§

fn take(&mut self) -> Self::Output

Source§

impl<A: Future, B: Future, C: Future, D: Future> Branches for (Branch<A>, Branch<B>, Branch<C>, Branch<D>)

Source§

type Output = (<A as Future>::Output, <B as Future>::Output, <C as Future>::Output, <D as Future>::Output)

Source§

fn poll_all(&mut self, start: f64, cx: &mut Context<'_>) -> Option<f64>

Source§

fn poll_any(&mut self, start: f64, cx: &mut Context<'_>) -> Option<(usize, f64)>

Source§

fn take(&mut self) -> Self::Output

Source§

impl<A: Future, B: Future, C: Future> Branches for (Branch<A>, Branch<B>, Branch<C>)

Source§

type Output = (<A as Future>::Output, <B as Future>::Output, <C as Future>::Output)

Source§

fn poll_all(&mut self, start: f64, cx: &mut Context<'_>) -> Option<f64>

Source§

fn poll_any(&mut self, start: f64, cx: &mut Context<'_>) -> Option<(usize, f64)>

Source§

fn take(&mut self) -> Self::Output

Source§

impl<A: Future, B: Future> Branches for (Branch<A>, Branch<B>)

Source§

type Output = (<A as Future>::Output, <B as Future>::Output)

Source§

fn poll_all(&mut self, start: f64, cx: &mut Context<'_>) -> Option<f64>

Source§

fn poll_any(&mut self, start: f64, cx: &mut Context<'_>) -> Option<(usize, f64)>

Source§

fn take(&mut self) -> Self::Output

Source§

impl<A: Future> Branches for (Branch<A>,)

Source§

type Output = (<A as Future>::Output,)

Source§

fn poll_all(&mut self, start: f64, cx: &mut Context<'_>) -> Option<f64>

Source§

fn poll_any(&mut self, start: f64, cx: &mut Context<'_>) -> Option<(usize, f64)>

Source§

fn take(&mut self) -> Self::Output

Implementors§