Skip to main content

Crate weir_core

Crate weir_core 

Source
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

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 coordinate::COORDINATE_FIXED_LEN;
pub use coordinate::COORDINATE_VERSION;
pub use coordinate::CoordinateError;
pub use coordinate::MAX_SEGMENT_NAME_LEN;
pub use coordinate::MAX_TRACKED_ACK_PAYLOAD_LEN;
pub use coordinate::RecordCoordinate;
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§

coordinate
RecordCoordinate — the durable address of one accepted record, and the payload codec for the AckTracked frame that carries it back to a producer.
durability
The Durability tier — the per-record durability guarantee a producer requests in the frame header.
envelope
The weir wire frame: Header (the 16-byte fixed header) and Envelope (header + payload), with the encode/decode codecs 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-level WeirError.
nack
The NackReason byte 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.