Trait rpc_it::service::Router

source ·
pub trait Router: Send + Sync + 'static {
    // Required methods
    fn register(
        &mut self,
        patterns: &[&str],
        index: usize
    ) -> Result<(), RegisterError>;
    fn route(&self, routing_key: &str) -> Option<usize>;

    // Provided method
    fn finish(&mut self) { ... }
}

Required Methods§

source

fn register( &mut self, patterns: &[&str], index: usize ) -> Result<(), RegisterError>

Register a routing key with the given index.

source

fn route(&self, routing_key: &str) -> Option<usize>

Route the given routing key to an index.

Provided Methods§

source

fn finish(&mut self)

Finish the registration process. All errors must’ve been reported through register, thus this method should never fail.

Implementors§