referrerpolicy=no-referrer-when-downgrade
frame_election_provider_support

Trait InstantElectionProvider

Source
pub trait InstantElectionProvider: ElectionProvider {
    // Required methods
    fn instant_elect(
        voters: Vec<VoterOf<Self::DataProvider>>,
        targets: Vec<Self::AccountId>,
        desired_targets: u32,
    ) -> Result<BoundedSupportsOf<Self>, Self::Error>;
    fn bother() -> bool;
}
Expand description

A (almost) marker trait that signifies an election provider as working synchronously. i.e. being instant.

This must still use the same data provider as with ElectionProvider::DataProvider. However, it can optionally overwrite the amount of voters and targets that are fetched from the data provider at runtime via forced_input_voters_bound and forced_input_target_bound.

Required Methods§

Source

fn instant_elect( voters: Vec<VoterOf<Self::DataProvider>>, targets: Vec<Self::AccountId>, desired_targets: u32, ) -> Result<BoundedSupportsOf<Self>, Self::Error>

Source

fn bother() -> bool

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.

Implementors§

Source§

impl<AccountId, BlockNumber, DataProvider, MaxWinnersPerPage, MaxBackersPerWinner> InstantElectionProvider for NoElection<(AccountId, BlockNumber, DataProvider, MaxWinnersPerPage, MaxBackersPerWinner)>
where DataProvider: ElectionDataProvider<AccountId = AccountId, BlockNumber = BlockNumber>, MaxWinnersPerPage: Get<u32>, MaxBackersPerWinner: Get<u32>,

Source§

impl<T: Config> InstantElectionProvider for OnChainExecution<T>