send_message

Function send_message 

Source
pub async fn send_message<W>(
    writer: &mut W,
    msg: &MineChatMessage,
) -> Result<(), MineChatError>
where W: AsyncWrite + Unpin,
Expand description

Sends a message to the server.

§Arguments

  • writer - A mutable reference to an asynchronous writer.
  • msg - A reference to the message to be sent.

§Returns

  • Result<(), MineChatError> - Returns Ok(()) if the message is sent successfully, otherwise returns an error.