pub async fn send(&mut self, msg: &Msg) -> Result<(), WampError> {
        // Serialize the data
        let payload = self.serializer.pack(msg)?;

        match std::str::from_utf8(&payload) {
            Ok(v) => debug!("Send : {}", v),
            Err(_) => debug!("Send : {:?}", msg),
        };

        // Send to host
        self.sock.send(&payload).await?;

        Ok(())
    }
/// Serializes a message and sends it on the transport
Serializes a message and sends it on the transport
Serializes a message and sends it on the transport
pub async fn send(&mut self, msg: &Msg) -> Result<(), WampError> {
        // Serialize the data
        let payload = self.serializer.pack(msg)?;
        match std::str::from_utf8(&payload) {
            Ok(v) => debug!("Send : {}", v),
            Err(_) => debug!("Send : {:?}", msg),
        };
        // Send to host
        self.sock.send(&payload).await?;
        Ok(())
    }
pub async fn send ( & mut self , msg : & Msg ) -> Result < ( ) , WampError > { // Serialize the data let payload = self . serializer . pack ( msg ) ? ; match std :: str :: from_utf8 ( & payload ) { Ok ( v ) => debug ! ( " " v ) , Err ( _ ) => debug ! ( " " msg ) , } ; // Send to host self . sock . send ( & payload ) . await ? ; Ok ( ( ) ) }
Serializes a message and sends it on the transport
Serializes a message and sends it on the transport
&mut self
msg
&Msg