Skip to main content

reddb_wire/
lib.rs

1//! RedDB wire protocol vocabulary.
2//!
3//! This crate is the shared, transport-agnostic layer that
4//! `reddb-server`, `reddb-client`, and the official language
5//! drivers depend on. It deliberately has no dependency on the
6//! engine, storage, or runtime modules.
7//!
8//! It owns the shared connection-string parser, audit-safe sanitizers,
9//! RedWire frame layout and codec, handshake payloads, topology payloads,
10//! query parameter encoding, queue/stream payloads, and replication wire
11//! messages. Listener loops, authentication policy, SQL dispatch, and
12//! runtime integration stay in `reddb-server`.
13
14#![allow(clippy::unwrap_used)]
15// Legacy allow for the cast_possible_truncation ratchet (PRD #1252):
16// pre-existing truncating `as` casts on frame lengths/offsets. The lint bites
17// on new/changed code; remove once those casts become checked conversions.
18#![allow(clippy::cast_possible_truncation)]
19
20pub mod auth;
21pub mod conn_string;
22pub mod jsonrpc;
23pub mod knowledge;
24pub mod legacy;
25pub mod query_with_params;
26pub mod redwire;
27pub mod replication;
28pub mod sanitizer;
29pub mod topology;
30
31pub use conn_string::{
32    is_embedded_connection_uri, parse, parse_with_auth, parse_with_limits, ConnStringLimits,
33    ConnectionAuth, ConnectionScheme, ConnectionSpec, ConnectionTarget, ParseError, ParseErrorKind,
34    DEFAULT_PORT_GRPC, DEFAULT_PORT_GRPCS, DEFAULT_PORT_RED, DEFAULT_PORT_WS, DEFAULT_PORT_WSS,
35    SUPPORTED_SCHEMES,
36};
37pub use knowledge::*;
38pub use redwire::{BuildError, FrameBuilder};
39pub use sanitizer::{
40    audit_safe_log_field, Boundary, ConnStringSanitizer, EscapeError, EscapedFor, ParsedConnString,
41    Tainted, TaintedRef, TaintedTarget,
42};
43pub use topology::{
44    decode_topology, encode_topology, Endpoint, ReplicaInfo, Topology, TopologyError,
45    MAX_KNOWN_TOPOLOGY_VERSION, TOPOLOGY_HEADER_SIZE, TOPOLOGY_WIRE_VERSION_V1,
46};