pub struct MessageHandler<M: ?Sized, F> { /* private fields */ }Expand description
A function for handling messages of specific type.
You can get it by calling IntoMessageHandler::into_message_handler on a function
which accepts a message.
Trait Implementations§
Source§impl<M: Message, F: FnMut(Arc<M>)> ErasedMessageHandler for MessageHandler<M, F>
impl<M: Message, F: FnMut(Arc<M>)> ErasedMessageHandler for MessageHandler<M, F>
Source§impl<F: FnMut(Arc<dyn Message>)> ErasedMessageHandler for MessageHandler<dyn Message, F>
impl<F: FnMut(Arc<dyn Message>)> ErasedMessageHandler for MessageHandler<dyn Message, F>
Source§impl<M: Message, F: FnMut(Arc<M>)> IntoMessageHandler<M> for MessageHandler<M, F>
impl<M: Message, F: FnMut(Arc<M>)> IntoMessageHandler<M> for MessageHandler<M, F>
type Handler = MessageHandler<M, F>
Source§fn into_message_handler(self) -> Self::Handler
fn into_message_handler(self) -> Self::Handler
Converts the type into the specific
ErasedMessageHandler.Source§impl<F: FnMut(Arc<dyn Message>)> IntoMessageHandler<dyn Message> for MessageHandler<dyn Message, F>
impl<F: FnMut(Arc<dyn Message>)> IntoMessageHandler<dyn Message> for MessageHandler<dyn Message, F>
type Handler = MessageHandler<dyn Message, F>
Source§fn into_message_handler(self) -> Self::Handler
fn into_message_handler(self) -> Self::Handler
Converts the type into the specific
ErasedMessageHandler.Auto Trait Implementations§
impl<M, F> Freeze for MessageHandler<M, F>
impl<M, F> RefUnwindSafe for MessageHandler<M, F>where
F: RefUnwindSafe,
M: ?Sized,
impl<M, F> Send for MessageHandler<M, F>
impl<M, F> Sync for MessageHandler<M, F>
impl<M, F> Unpin for MessageHandler<M, F>
impl<M, F> UnwindSafe for MessageHandler<M, F>where
F: UnwindSafe,
M: ?Sized,
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