Skip to main content

write_message

Function write_message 

Source
pub async fn write_message(
    send: &mut SendStream,
    type_byte: u8,
    payload: &[u8],
) -> Result<(), PyroLinkError>
Expand description

Write one framed message to the stream.

Encodes type_byte + len(4B LE) + payload and writes it to the stream.

§Errors

Returns PyroLinkError::Stream if the underlying write fails.