Struct BaseRouter
pub struct BaseRouter {}Expand description
Base router implementation that can be extended by specific router types
Implementations§
§impl BaseRouter
impl BaseRouter
pub fn new() -> BaseRouter
pub fn new() -> BaseRouter
Create a new base router
Trait Implementations§
§impl MessageRouter for BaseRouter
impl MessageRouter for BaseRouter
§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 BaseRouter
impl RefUnwindSafe for BaseRouter
impl Send for BaseRouter
impl Sync for BaseRouter
impl Unpin for BaseRouter
impl UnwindSafe for BaseRouter
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