logo
pub async fn write_one(
    socket: &'_ mut impl AsyncWrite + Unpin,
    data: impl AsRef<[u8]>
) -> Result<(), Error>
Expand description

Send a message to the given socket, then shuts down the writing side.

Note: Prepends a variable-length prefix indicate the length of the message. This is compatible with what read_one expects.