Skip to main content

Crate shuflr_wire

Crate shuflr_wire 

Source
Expand description

shuflr-wire/1 protocol codec — pure framing / parsing with no I/O.

Specced in docs/design/005-serve-multi-transport.md §3. This crate knows nothing about sockets, TLS, pyo3, or tokio. It turns Message values into bytes and back, with an xxh3 checksum on every non-handshake frame.

The transport (PR-33) drives this codec from a tokio::io::{AsyncReadExt, AsyncWriteExt} loop; the shuflr- client Python wheel (PR-34b) uses it from a blocking std::io loop. Both sides use the same encode/decode pair — byte-for-byte compat is pinned by the proptest round-trip harness in tests/.

Re-exports§

pub use codec::DecodeOptions;
pub use codec::Decoder;
pub use codec::HandshakeRole;
pub use codec::MIN_FRAME_BYTES;
pub use codec::encode;
pub use codec::encode_handshake;
pub use codec::encode_into;
pub use error::WireError;
pub use message::AuthKind;
pub use message::BatchPayload;
pub use message::ChosenMode;
pub use message::ClientHello;
pub use message::HandshakeStatus;
pub use message::Kind;
pub use message::Message;
pub use message::ServerHello;
pub use message::StreamErrorCode;

Modules§

codec
Encoder / decoder for shuflr-wire/1.
error
Typed errors for the wire codec.
message
Typed message model for shuflr-wire/1. Mirrors 005 §3.2-3.4.

Constants§

MAGIC
MAX_MESSAGE_BYTES
Server-side hard cap on any single message body. 005 §3.1. Chosen to exceed EDGAR’s largest single-record frame (427 MiB) with headroom without leaving the door open for multi-GB pathological messages.
VERSION