async fn write_message<W, M>(writer: W, msg: Option<&M>) -> Result<()>
Expand description
Write a message into the given writer.
The message can be None
, in which case an empty message is written. This is used to implement
keepalives. At the receiver, empty messages are ignored, but they do reset the read timeout.