Function nix_compat::wire::write_bytes
source · pub async fn write_bytes<W: AsyncWriteExt + Unpin, B: AsRef<[u8]>>(
w: &mut W,
b: B,
) -> Result<()>
Expand description
Writes a “bytes wire packet” to a (hopefully buffered) AsyncWriteExt.
Accepts anything implementing AsRef<u8> as payload.
See read_bytes for a description of the format.
Note: if performance matters to you, make sure your AsyncWriteExt handle is buffered. This function is quite write-intesive.