referrerpolicy=no-referrer-when-downgrade
pub trait AssignmentProvider<BlockNumber> {
    // Required methods
    fn pop_assignment_for_core(core_idx: CoreIndex) -> Option<Assignment>;
    fn report_processed(assignment: Assignment);
    fn push_back_assignment(assignment: Assignment);
    fn get_mock_assignment(core_idx: CoreIndex, para_id: ParaId) -> Assignment;
    fn assignment_duplicated(assignment: &Assignment);
}

Required Methods§

source

fn pop_assignment_for_core(core_idx: CoreIndex) -> Option<Assignment>

Pops an Assignment from the provider for a specified [CoreIndex].

This is where assignments come into existence.

source

fn report_processed(assignment: Assignment)

A previously popped Assignment has been fully processed.

Report back to the assignment provider that an assignment is done and no longer present in the scheduler.

This is one way of the life of an assignment coming to an end.

source

fn push_back_assignment(assignment: Assignment)

Push back a previously popped assignment.

If the assignment could not be processed within the current session, it can be pushed back to the assignment provider in order to be popped again later.

This is the second way the life of an assignment can come to an end.

source

fn get_mock_assignment(core_idx: CoreIndex, para_id: ParaId) -> Assignment

Push some assignment for mocking/benchmarks purposes.

Useful for benchmarks and testing. The returned assignment is “valid” and can if need be passed into report_processed for example.

source

fn assignment_duplicated(assignment: &Assignment)

Report that an assignment was duplicated by the scheduler.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T: Config> AssignmentProvider<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>