rustmax::tower::steer

Trait Picker

Source
pub trait Picker<S, Req> {
    // Required method
    fn pick(&mut self, r: &Req, services: &[S]) -> usize;
}
Expand description

This is how callers of Steer tell it which Service a Req corresponds to.

Required Methods§

Source

fn pick(&mut self, r: &Req, services: &[S]) -> usize

Return an index into the iterator of Service passed to Steer::new.

Implementors§

Source§

impl<S, F, Req> Picker<S, Req> for F
where F: Fn(&Req, &[S]) -> usize,