pub fn into_text(self) -> Result<String> {
        match self {
            Message::Text(string) => Ok(string),
            Message::Binary(data) | Message::Ping(data) | Message::Pong(data) => {
                Ok(String::from_utf8(data).map_err(|err| err.utf8_error())?)
            }
            Message::Close(None) => Ok(String::new()),
            Message::Close(Some(frame)) => Ok(frame.reason.into_owned()),
        }
    }
/// Attempt to consume the WebSocket message and convert it to a String.
Attempt to consume the WebSocket message and convert it to a String.
Attempt to consume the WebSocket message and convert it to a String .
pub fn into_text(self) -> Result<String> {
        match self {
            Message::Text(string) => Ok(string),
            Message::Binary(data) | Message::Ping(data) | Message::Pong(data) => {
                Ok(String::from_utf8(data).map_err(|err| err.utf8_error())?)
            }
            Message::Close(None) => Ok(String::new()),
            Message::Close(Some(frame)) => Ok(frame.reason.into_owned()),
        }
    }
pub fn into_text ( self ) -> Result < String > { match self { Message :: Text ( string ) => Ok ( string ) , Message :: Binary ( data ) | Message :: Ping ( data ) | Message :: Pong ( data ) => { Ok ( String :: from_utf8 ( data ) . map_err ( | err | err . utf8_error ( ) ) ? ) } Message :: Close ( None ) => Ok ( String :: new ( ) ) , Message :: Close ( Some ( frame ) ) => Ok ( frame . reason . into_owned ( ) ) , } }
Attempt to consume the WebSocket message and convert it to a String.
Attempt to consume the WebSocket message and convert it to a String .
self
self