pub trait ElectionProvider: ElectionProviderBase {
// Required methods
fn ongoing() -> bool;
fn elect() -> Result<BoundedSupportsOf<Self>, Self::Error>;
}
Expand description
Elect a new set of winners, bounded by MaxWinners
.
It must always use ElectionProviderBase::DataProvider
to fetch the data it needs.
This election provider that could function asynchronously. This implies that this election might
needs data ahead of time (ergo, receives no arguments to elect
), and might be ongoing
at
times.
Required Methods§
Sourcefn ongoing() -> bool
fn ongoing() -> bool
Indicate if this election provider is currently ongoing an asynchronous election or not.
Sourcefn elect() -> Result<BoundedSupportsOf<Self>, Self::Error>
fn elect() -> Result<BoundedSupportsOf<Self>, Self::Error>
Performs the election. This should be implemented as a self-weighing function. The implementor should register its appropriate weight at the end of execution with the system pallet directly.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.