Skip to main content

Module wire

Module wire 

Source
Expand description

The wire format: length-prefixed messages on one weirdnet-net stream.

Each message is a big-endian u32 length, then a type byte, then the body. The subscriber sends one Msg::Hello; the publisher answers Msg::Info or Msg::Refused, then frames, info changes and finally Msg::Ended.

Structs§

Hello
What the subscriber asks for.

Enums§

Msg
One message.

Constants§

MAX_MESSAGE
The largest message accepted (16 MiB).

Functions§

read
Read one message; Ok(None) at a clean end of stream.
write
Write one message.