Trait elfo_core::routers::Router

source ·
pub trait Router<C>: Send + Sync + 'static {
    type Key: Clone + Hash + Eq + Display + Send + Sync;

    // Required method
    fn route(&self, envelope: &Envelope) -> Outcome<Self::Key>;

    // Provided method
    fn update(&self, _config: &C) { ... }
}

Required Associated Types§

Required Methods§

source

fn route(&self, envelope: &Envelope) -> Outcome<Self::Key>

Provided Methods§

source

fn update(&self, _config: &C)

Implementations on Foreign Types§

source§

impl<C> Router<C> for ()

§

type Key = Singleton

source§

fn route(&self, envelope: &Envelope) -> Outcome<Self::Key>

Implementors§

source§

impl<C, R, K> Router<C> for MapRouter<C, (), (), R>where C: Send + Sync + 'static, R: Fn(&Envelope) -> Outcome<K> + Send + Sync + 'static, K: Clone + Hash + Eq + Display + Send + Sync,

§

type Key = K

source§

impl<C, S, P, R, K> Router<C> for MapRouter<C, ArcSwap<S>, P, R>where C: Send + Sync + 'static, S: Send + Sync + 'static, R: Fn(&Envelope, &S) -> Outcome<K> + Send + Sync + 'static, P: Fn(&C, &S) -> S + Send + Sync + 'static, K: Clone + Hash + Eq + Display + Send + Sync,

§

type Key = K