Function netcore::framing::write_u16frame[][src]

pub async fn write_u16frame<'stream, 'buf, 'c, TSocket>(
    stream: &'stream mut TSocket,
    buf: &'buf [u8]
) -> Result<()> where
    'stream: 'c,
    'buf: 'c,
    TSocket: AsyncWrite + Unpin
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.