pub trait SolutionDataProvider {
type Solution;
// Required methods
fn get_page(page: PageIndex) -> Option<Self::Solution>;
fn get_score() -> Option<ElectionScore>;
fn report_result(result: VerificationResult);
}
Expand description
Something that can provide candidate solutions to the verifier.
In reality, this can be implemented by the crate::signed::Pallet
, where signed solutions are
queued and sorted based on claimed score, and they are put forth one by one, from best to worse.
Required Associated Types§
Required Methods§
Sourcefn get_page(page: PageIndex) -> Option<Self::Solution>
fn get_page(page: PageIndex) -> Option<Self::Solution>
Return the page
th page of the current best solution that the data provider has in store.
If no candidate solutions are available, then None is returned.
Sourcefn get_score() -> Option<ElectionScore>
fn get_score() -> Option<ElectionScore>
Get the claimed score of the current best solution.
Sourcefn report_result(result: VerificationResult)
fn report_result(result: VerificationResult)
Hook to report back the results of the verification of the current candidate solution that
is being exposed via Self::get_page
and Self::get_score
.
Every time that this is called, the verifier AsynchronousVerifier
goes back to the
Status::Nothing
state, and it is the responsibility of Self
to call start
again,
if desired.
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.