/// Convenience wrapper around send_bytes
/// Deserialize a message and feed the bytes into send_bytes
Convenience wrapper around send_bytes
Deserialize a message and feed the bytes into send_bytes
Convenience wrapper around send_bytes Deserialize a message and feed the bytes into send_bytes
pub async fn send_message(message: &Message, socket: &mut TcpStream) -> Result<()> {
    debug!("Sending message: {:?}", message);
    // Prepare command for transfer and determine message byte size
    let payload = serde_json::to_string(message)
        .expect("Failed to serialize message.")
        .into_bytes();
    send_bytes(payload, socket).await
}
pub async fn send_message ( message : & Message , socket : & mut TcpStream ) -> Result < ( ) > { debug ! ( " " message ) ; // Prepare command for transfer and determine message byte size let payload = serde_json :: to_string ( message ) . expect ( " " ) . into_bytes ( ) ; send_bytes ( payload , socket ) . await }
Convenience wrapper around send_bytes
Deserialize a message and feed the bytes into send_bytes
Convenience wrapper around send_bytes Deserialize a message and feed the bytes into send_bytes
message
&Message
socket
&mut TcpStream