Trait AppMessageExt

Source
pub trait AppMessageExt {
    // Required methods
    fn add_message<M>(&mut self) -> MessageRegistration<'_, M>
       where M: Message + Serialize + DeserializeOwned;
    fn is_message_registered<M>(&self) -> bool
       where M: Message;
    fn add_message_custom_serde<M>(
        &mut self,
        serialize_fns: SerializeFns<M>,
    ) -> MessageRegistration<'_, M>
       where M: Message;
}
Expand description

Add messages or triggers to the list of types that can be sent.

Required Methods§

Source

fn add_message<M>(&mut self) -> MessageRegistration<'_, M>

Register a regular message type M. This adds MessageSender<M> and MessageReceiver<M> components.

Source

fn is_message_registered<M>(&self) -> bool
where M: Message,

Source

fn add_message_custom_serde<M>( &mut self, serialize_fns: SerializeFns<M>, ) -> MessageRegistration<'_, M>
where M: Message,

Register a regular message type M with custom serialization functions.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl AppMessageExt for App

Source§

fn add_message<M>(&mut self) -> MessageRegistration<'_, M>

Source§

fn is_message_registered<M>(&self) -> bool
where M: Message,

Source§

fn add_message_custom_serde<M>( &mut self, serialize_fns: SerializeFns<M>, ) -> MessageRegistration<'_, M>
where M: Message,

Implementors§