Expand description
Core wire-protocol types shared by the weir daemon, client, and sink SDK.
weir-core is the dependency-light foundation of the weir workspace: it
defines the v1 binary frame format and nothing else (no I/O, no async, no
daemon logic). Everything that crosses the socket is built from these types.
§What’s here
Envelope/Header— a complete wire frame and its 16-byte header, withencode/decodethat own the CRC and validation order.MessageType/Durability/NackReason— the fixed-repr enums carried in the header and Nack payloads, each with aTryFrom<u8>whose error isUnknownMessageType/UnknownDurability/UnknownNackReason(re-exported here alongside the enums).Payload— opaque, ref-counted payload bytes (O(1) clone).DecodeError/WeirError— the decode failure taxonomy.WIRE_VERSION/MAX_PAYLOAD_HARD_CAP/HEADER_LEN/MIN_FRAME_LEN— the protocol constants.
The wire format itself is specified in docs/wire_protocol.md; this crate
is its executable reference (see tests/reference_frames.rs).
Re-exports§
pub use durability::Durability;pub use durability::UnknownDurability;pub use envelope::Envelope;pub use envelope::HEADER_LEN;pub use envelope::Header;pub use envelope::MIN_FRAME_LEN;pub use envelope::MessageType;pub use envelope::UnknownMessageType;pub use error::DecodeError;pub use error::WeirError;pub use nack::NackReason;pub use nack::UnknownNackReason;pub use payload::Payload;pub use version::MAX_PAYLOAD_HARD_CAP;pub use version::WIRE_VERSION;
Modules§
- durability
- The
Durabilitytier — the per-record durability guarantee a producer requests in the frame header. - envelope
- The weir wire frame:
Header(the 16-byte fixed header) andEnvelope(header + payload), with theencode/decodecodecs that own CRC computation and the DoS-resistant validation order. - error
- The decode failure taxonomy:
DecodeError(one variant per frame-validation step, which the daemon maps to a Nack reason) and the top-levelWeirError. - nack
- The
NackReasonbyte that prefixes every Nack message payload. - payload
- The opaque payload byte buffer carried end-to-end through weir.
- version
- Wire-protocol version and the absolute payload-size ceiling — the protocol constants every layer shares.