Skip to main content

Module wire

Module wire 

Source
Expand description

Canonical host/guest input wire format.

The input stream is encoded as u32 words where:

  • the first word stores payload byte length,
  • each following word stores up to 4 payload bytes in big-endian order,
  • the final word is zero-padded when payload length is not a multiple of 4.

Structs§

EndOfFrame
Error from FramedRead::read: the frame ran out before the request could be satisfied. shortfall is how many more bytes were requested than the frame still holds; on this error the reader is left unadvanced.
FramedReader
Streaming counterpart to read_framed_bytes_with: a FramedRead source that pulls framed words on demand instead of first materializing the whole payload into a Vec<u8>. Only a single word is buffered at a time, so it holds O(1) memory regardless of payload size — letting a decoder run at ~1x peak memory rather than the ~2x of “buffer the blob, then decode it”.

Enums§

WireError
Errors that can occur while framing input payloads.

Traits§

FramedRead
A source of framed payload bytes read on demand. This keeps the framing and word-transport concern in core, decoupled from any serializer — a bincode bridge over FramedRead lives in the codec crate, so core needs no dependency on bincode.

Functions§

frame_words_from_bytes
Frame payload bytes into input words consumed by the runtime.
read_framed_bytes_with
Read one framed payload from a word source.