Function send_ok

pub async fn send_ok<T>(
    send: &mut SendStream,
    buf: &mut Vec<u8>,
    body: T,
) -> Result<(), Error>
where T: Serialize,
Expand description

Sends an Ok 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.