future_queue::traits

Trait GroupedWeightedFuture

Source
pub trait GroupedWeightedFuture: Sealed {
    type F: FnOnce(FutureQueueContext) -> Self::Future;
    type Future: Future;
    type Q;

    // Required methods
    fn weight(&self) -> usize;
    fn into_components(self) -> (usize, Option<Self::Q>, Self::F);
}
Expand description

A trait for types which can be converted into functions that return a Future, an optional group, and a weight.

Provided in case it’s necessary. This trait is only implemented for (usize, Option<Q>, impl Future).

Required Associated Types§

Source

type F: FnOnce(FutureQueueContext) -> Self::Future

The function to obtain the future from.

Source

type Future: Future

The associated Future type.

Source

type Q

The associated key lookup type.

Required Methods§

Source

fn weight(&self) -> usize

Returns the weight.

Source

fn into_components(self) -> (usize, Option<Self::Q>, Self::F)

Turns self into its components.

Implementations on Foreign Types§

Source§

impl<F, Fut, Q> GroupedWeightedFuture for (usize, Option<Q>, F)
where F: FnOnce(FutureQueueContext) -> Fut, Fut: Future,

Source§

type F = F

Source§

type Future = Fut

Source§

type Q = Q

Source§

fn weight(&self) -> usize

Source§

fn into_components(self) -> (usize, Option<Self::Q>, Self::F)

Implementors§