Function send_err

pub async fn send_err<E>(
    send: &mut SendStream,
    buf: &mut Vec<u8>,
    e: E,
) -> Result<(), Error>
where E: Display,
Expand description

Sends an Err response.

buf will be cleared after the response is sent.

ยงErrors

Returns std::io::ErrorKind::InvalidData if the message is too large, or other errors if the message could not be written to the stream.