Skip to main content

AffinitySelector

Trait AffinitySelector 

Source
pub trait AffinitySelector<K, N> {
    // Required method
    fn select(&self, key: &K) -> N;
}
Expand description

Pure, statically dispatched policy for a previously unseen affinity key.

Required Methods§

Source

fn select(&self, key: &K) -> N

Select the stable worker nonce for a key that has no binding yet.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<K, N, F> AffinitySelector<K, N> for F
where F: Fn(&K) -> N,