[][src]Function tobytcp::send

pub async fn send<'w, W>(
    data: &'w [u8],
    write: &'w mut W
) -> Result<usize, Error> where
    W: AsyncWrite + Unpin

Writes the data, encoded as tobytcp, to the Write. Returns the total number of bytes written, equal to data.len() + 8. See the examples/ dir in the source code, or the tests of this fn in the source code for some examples of this being used.

Note: Do not perform any IO on the Write outside of calling send or receive! It can corrupt the tobytcp stream