Skip to main content

Module redwire

Module redwire 

Source
Expand description

RedWire — RedDB’s binary TCP / TLS wire protocol with auth handshake, multiplex, compression, and version negotiation.

See docs/adr/0001-redwire-tcp-protocol.md. The protocol is gated on a 0xFE startup magic byte so the listener can share a port with HTTP and gRPC behind the service router.

Layered API:

  • frame — frame struct + MessageKind + flags
  • codec — encode/decode (16-byte header + payload)
  • auth — handshake state machine
  • session — per-connection dispatch loop
  • listener — TCP / TLS / Unix accept

Re-exports§

pub use listener::start_redwire_unix_listener;
pub use listener::start_redwire_listener;
pub use listener::start_redwire_listener_on;
pub use listener::start_redwire_tls_listener;
pub use listener::RedWireConfig;

Modules§

auth
Handshake state machine + auth method dispatch.
codec
Re-export of the canonical RedWire codec from reddb-wire.
frame
Re-export of the canonical RedWire frame types from reddb-wire.
listener
TCP / TLS / Unix listeners for the RedWire protocol.
session
Per-connection RedWire session: handshake → frame loop → bye.

Structs§

Flags
Frame
FrameBuilder
Builder for server-emitted Frames.

Enums§

BuildError
Errors surfaced at build() time so they fail at construction rather than at encode time, where the call site has already lost the context to recover.
FrameError
MessageKind
Single-byte message-kind discriminator. Numeric values are part of the wire spec — never repurpose a value once shipped.

Constants§

DEFAULT_REDWIRE_PORT
Default port for the RedWire listener.
FRAME_HEADER_SIZE
MAX_FRAME_SIZE
MAX_KNOWN_MINOR_VERSION
Highest minor version the server supports. Wire-bumped as we add features that change the handshake; data-plane additions flow through Hello.features instead.
REDWIRE_MAGIC
Discriminator byte every RedWire client sends as the very first byte off the wire. The service-router detector keys off this (and so does the standalone listener path).

Functions§

decode_frame
encode_frame