pub trait RouteSelector {
    // Required method
    fn select<'a>(
        &'a self,
        insertion_ctx: &'a InsertionContext,
        jobs: &[&'a Job]
    ) -> Box<dyn Iterator<Item = &'a RouteContext> + 'a>;

    // Provided method
    fn prepare(&self, insertion_ctx: &mut InsertionContext) { ... }
}
Expand description

On each insertion step, selects a list of routes where jobs can be inserted. It is up to implementation to decide whether list consists of all possible routes or just some subset.

Required Methods§

source

fn select<'a>( &'a self, insertion_ctx: &'a InsertionContext, jobs: &[&'a Job] ) -> Box<dyn Iterator<Item = &'a RouteContext> + 'a>

Returns routes for job insertion.

Provided Methods§

source

fn prepare(&self, insertion_ctx: &mut InsertionContext)

This method is called before select. It allows to apply some changes on mutable context before immutable borrowing could happen within select method. Default implementation simply shuffles existing routes.

Implementors§