pub fn register<M: ChannelMessage>(
        &mut self,
        settings: MessageChannelSettings,
    ) -> Result<(), ChannelAlreadyRegistered> {
        if !self.channels.insert(settings.channel) {
            return Err(ChannelAlreadyRegistered::Channel);
        }

        match self.register_fns.entry(TypeId::of::<M>()) {
            hash_map::Entry::Occupied(_) => Err(ChannelAlreadyRegistered::MessageType),
            hash_map::Entry::Vacant(vacant) => {
                vacant.insert((type_name::<M>(), settings, register_message_type::<R, P, M>));
                Ok(())
            }
        }
    }
/// Register this message type on the constructed `MessageChannels`, using the given channel
/// settings.
///
/// Can only be called once per message type, will error if it is called with the same message
/// type more than once.
Register this message type on the constructed `MessageChannels`, using the given channel
settings.

Can only be called once per message type, will error if it is called with the same message
type more than once.
Register this message type on the constructed ` MessageChannels ` using the given channel settings . Can only be called once per message type will error if it is called with the same message type more than once .
pub fn register<M: ChannelMessage>(
        &mut self,
        settings: MessageChannelSettings,
    ) -> Result<(), ChannelAlreadyRegistered> {
        if !self.channels.insert(settings.channel) {
            return Err(ChannelAlreadyRegistered::Channel);
        }
        match self.register_fns.entry(TypeId::of::<M>()) {
            hash_map::Entry::Occupied(_) => Err(ChannelAlreadyRegistered::MessageType),
            hash_map::Entry::Vacant(vacant) => {
                vacant.insert((type_name::<M>(), settings, register_message_type::<R, P, M>));
                Ok(())
            }
        }
    }
pub fn register < M : ChannelMessage > ( & mut self , settings : MessageChannelSettings , ) -> Result < ( ) , ChannelAlreadyRegistered > { if ! self . channels . insert ( settings . channel ) { return Err ( ChannelAlreadyRegistered :: Channel ) ; } match self . register_fns . entry ( TypeId :: of :: < M > ( ) ) { hash_map :: Entry :: Occupied ( _ ) => Err ( ChannelAlreadyRegistered :: MessageType ) , hash_map :: Entry :: Vacant ( vacant ) => { vacant . insert ( ( type_name :: < M > ( ) , settings , register_message_type :: < R , P , M > ) ) ; Ok ( ( ) ) } } }
Register this message type on the constructed `MessageChannels`, using the given channel
settings.
Register this message type on the constructed ` MessageChannels ` using the given channel settings .
&mut self
settings
MessageChannelSettings
&mut self
settings
MessageChannelSettings