pub fn try_send<M: ChannelMessage>(
        &mut self,
        message: M,
    ) -> Result<Option<M>, MessageTypeUnregistered> {
        let channels = self.channels.get_mut::<M>()?;

        Ok(if self.disconnected {
            Some(message)
        } else if let Err(err) = channels.outgoing_sender.try_send(message) {
            if err.is_disconnected() {
                self.disconnected = true;
            }
            Some(err.into_inner())
        } else {
            None
        })
    }
/// Like `MessageChannels::send` but errors instead of panicking when the message type is
/// unregistered.
Like `MessageChannels::send` but errors instead of panicking when the message type is
unregistered.
Like ` MessageChannels :: send ` but errors instead of panicking when the message type is unregistered .
pub fn try_send<M: ChannelMessage>(
        &mut self,
        message: M,
    ) -> Result<Option<M>, MessageTypeUnregistered> {
        let channels = self.channels.get_mut::<M>()?;
        Ok(if self.disconnected {
            Some(message)
        } else if let Err(err) = channels.outgoing_sender.try_send(message) {
            if err.is_disconnected() {
                self.disconnected = true;
            }
            Some(err.into_inner())
        } else {
            None
        })
    }
pub fn try_send < M : ChannelMessage > ( & mut self , message : M , ) -> Result < Option < M > , MessageTypeUnregistered > { let channels = self . channels . get_mut :: < M > ( ) ? ; Ok ( if self . disconnected { Some ( message ) } else if let Err ( err ) = channels . outgoing_sender . try_send ( message ) { if err . is_disconnected ( ) { self . disconnected = true ; } Some ( err . into_inner ( ) ) } else { None } ) }
Like `MessageChannels::send` but errors instead of panicking when the message type is
unregistered.
Like ` MessageChannels :: send ` but errors instead of panicking when the message type is unregistered .
&mut self
message
M
&mut self
message
M