Struct SimpleMessageRouter
pub struct SimpleMessageRouter { /* private fields */ }Expand description
Simple message router implementation
Implementations§
§impl SimpleMessageRouter
impl SimpleMessageRouter
pub fn new() -> SimpleMessageRouter
pub fn new() -> SimpleMessageRouter
Create a new simple message router
Trait Implementations§
§impl MessageRouter for SimpleMessageRouter
impl MessageRouter for SimpleMessageRouter
§fn add_route(
&mut self,
pattern: TopicPattern,
handler: Box<dyn MessageHandler>,
priority: u32,
) -> Result<(), NerveError>
fn add_route( &mut self, pattern: TopicPattern, handler: Box<dyn MessageHandler>, priority: u32, ) -> Result<(), NerveError>
Add a route for a topic pattern
§fn remove_route(&mut self, pattern: &TopicPattern) -> Result<(), NerveError>
fn remove_route(&mut self, pattern: &TopicPattern) -> Result<(), NerveError>
Remove a route
§fn route_message(
&self,
_topic: &str,
_message: &Message,
) -> Result<(), NerveError>
fn route_message( &self, _topic: &str, _message: &Message, ) -> Result<(), NerveError>
Route a message to appropriate handlers
§fn statistics(&self) -> RoutingStatistics
fn statistics(&self) -> RoutingStatistics
Get routing statistics
§fn clear_routes(&mut self) -> Result<(), NerveError>
fn clear_routes(&mut self) -> Result<(), NerveError>
Clear all routes
Auto Trait Implementations§
impl !Freeze for SimpleMessageRouter
impl RefUnwindSafe for SimpleMessageRouter
impl Send for SimpleMessageRouter
impl Sync for SimpleMessageRouter
impl Unpin for SimpleMessageRouter
impl UnwindSafe for SimpleMessageRouter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more