pub fn to_str(&self) -> Result<&str, Error> {
        match self.inner {
            protocol::Message::Text(ref s) => Ok(s),
            _ => Err(Error::InvalidMessageType),
        }
    }
/// Tries to get a reference to the string text, if this is a Text message.
Tries to get a reference to the string text, if this is a Text message.
Tries to get a reference to the string text if this is a Text message .
pub fn to_str(&self) -> Result<&str, Error> {
        match self.inner {
            protocol::Message::Text(ref s) => Ok(s),
            _ => Err(Error::InvalidMessageType),
        }
    }
pub fn to_str ( & self ) -> Result < & str , Error > { match self . inner { protocol :: Message :: Text ( ref s ) => Ok ( s ) , _ => Err ( Error :: InvalidMessageType ) , } }
Tries to get a reference to the string text, if this is a Text message.
Tries to get a reference to the string text if this is a Text message .
&self
&self