Skip to main content

MessageRouter

Trait MessageRouter 

Source
pub trait MessageRouter:
    Send
    + Sync
    + Debug {
    // Required methods
    fn route<'life0, 'async_trait>(
        &'life0 mut self,
        message: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn is_route_valid(&self, from: &str, to: &str) -> bool;
    fn valid_targets(&self) -> Vec<String>;
}
Expand description

Message routing trait

Required Methods§

Source

fn route<'life0, 'async_trait>( &'life0 mut self, message: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Route a message according to hierarchical rules

Source

fn is_route_valid(&self, from: &str, to: &str) -> bool

Check if a route is valid for the current phase

Source

fn valid_targets(&self) -> Vec<String>

Get valid routing targets for this platform

Implementors§