pub trait WeightedFuture: Sealed {
type F: FnOnce(FutureQueueContext) -> Self::Future;
type Future: Future;
// Required methods
fn weight(&self) -> usize;
fn into_components(self) -> (usize, Self::F);
}
Expand description
A trait for types which can be converted into a Future
and a weight.
Provided in case it’s necessary. This trait is only implemented for (usize, impl Future)
.
Required Associated Types§
Sourcetype F: FnOnce(FutureQueueContext) -> Self::Future
type F: FnOnce(FutureQueueContext) -> Self::Future
The function to obtain the future from
Required Methods§
Sourcefn into_components(self) -> (usize, Self::F)
fn into_components(self) -> (usize, Self::F)
Turns self into its components.