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§
Sourcetype F: FnOnce(FutureQueueContext) -> Self::Future
type F: FnOnce(FutureQueueContext) -> Self::Future
The function to obtain the future from.