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§
Sourcefn 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 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
Sourcefn is_route_valid(&self, from: &str, to: &str) -> bool
fn is_route_valid(&self, from: &str, to: &str) -> bool
Check if a route is valid for the current phase
Sourcefn valid_targets(&self) -> Vec<String>
fn valid_targets(&self) -> Vec<String>
Get valid routing targets for this platform