Available on crate feature
embedded only.Expand description
Length-prefix framing for EmbeddedLeg.
embedded-io-async is a byte stream; SessionTransport is message-
oriented. Each frame is [len: u32 BE][payload] — byte-identical to
TcpSessionTransport’s framing, so an embedded client and a TCP server
interoperate at this layer. Pure: no I/O and no state — the leg drives the
actual reads and writes and owns the buffer.
Phase 3.6 (no-std foundation): pure logic, zero imports outside the
prelude. The crate-level #![cfg_attr(not(feature = "std"), no_std)] in
lib.rs drives the no_std switch; this module needs no extra attribute.
Enums§
- Framing
Error - Errors from length-prefix framing.
Constants§
- HEADER_
LEN - Width of the big-endian length prefix prepended to every frame.
Functions§
- decode_
header - Decode a big-endian length prefix, validating the frame it announces fits
a receiver buffer of
capacitybytes. - encode_
header - Encode the big-endian length prefix for an outbound frame of
payload_lenbytes, validating it fits a receiver buffer ofcapacitybytes.