Trait sp_election_providers::ElectionProvider[][src]

pub trait ElectionProvider<AccountId, BlockNumber> {
    type Error: Debug;
    type DataProvider: ElectionDataProvider<AccountId, BlockNumber>;
    fn elect() -> Result<Supports<AccountId>, Self::Error>;
}

Something that can compute the result of an election and pass it back to the caller.

This trait only provides an interface to request an election, i.e. ElectionProvider::elect. That data required for the election need to be passed to the implemented of this trait through ElectionProvider::DataProvider.

Associated Types

type Error: Debug[src]

The error type that is returned by the provider.

type DataProvider: ElectionDataProvider<AccountId, BlockNumber>[src]

The data provider of the election.

Loading content...

Required methods

fn elect() -> Result<Supports<AccountId>, Self::Error>[src]

Elect a new set of winners.

The result is returned in a target major format, namely as vector of supports.

Loading content...

Implementations on Foreign Types

impl<AccountId, BlockNumber> ElectionProvider<AccountId, BlockNumber> for ()[src]

type Error = &'static str

type DataProvider = ()

Loading content...

Implementors

Loading content...