Function netcore::framing::write_u16frame
source · pub async fn write_u16frame<'stream, 'buf, 'c, TSocket>(
stream: &'stream mut TSocket,
buf: &'buf [u8]
) -> Result<()>where
TSocket: AsyncWrite + Unpin,
'stream: 'c,
'buf: 'c,
Expand description
Write the contents of buf
to stream
prefixed with a u16 length.
The length of buf
must be less than or equal to u16::max_value().
Caller is responsible for flushing the write to stream
.