pub struct MessageDispatcher { /* private fields */ }Expand description
Dispatcher that routes messages to specific handlers based on template ID.
Implementations§
Source§impl MessageDispatcher
impl MessageDispatcher
Sourcepub fn register<H: TypedHandler + 'static>(
&mut self,
template_id: u16,
handler: H,
)
pub fn register<H: TypedHandler + 'static>( &mut self, template_id: u16, handler: H, )
Registers a handler for a specific template ID.
Sourcepub fn set_default<H: MessageHandler + 'static>(&mut self, handler: H)
pub fn set_default<H: MessageHandler + 'static>(&mut self, handler: H)
Sets the default handler for unregistered template IDs.
Sourcepub fn has_handler(&self, template_id: u16) -> bool
pub fn has_handler(&self, template_id: u16) -> bool
Returns true if a handler is registered for the given template ID.
Trait Implementations§
Source§impl Default for MessageDispatcher
impl Default for MessageDispatcher
Source§impl MessageHandler for MessageDispatcher
impl MessageHandler for MessageDispatcher
Source§fn on_message(
&self,
session_id: u64,
header: &MessageHeader,
buffer: &[u8],
responder: &dyn Responder,
)
fn on_message( &self, session_id: u64, header: &MessageHeader, buffer: &[u8], responder: &dyn Responder, )
Called when a complete SBE message is received. Read more
Source§fn on_session_start(&self, session_id: u64)
fn on_session_start(&self, session_id: u64)
Called when a new session is established. Read more
Source§fn on_session_end(&self, session_id: u64)
fn on_session_end(&self, session_id: u64)
Called when a session ends. Read more
Auto Trait Implementations§
impl Freeze for MessageDispatcher
impl !RefUnwindSafe for MessageDispatcher
impl Send for MessageDispatcher
impl Sync for MessageDispatcher
impl Unpin for MessageDispatcher
impl UnsafeUnpin for MessageDispatcher
impl !UnwindSafe for MessageDispatcher
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