Skip to main content

Module conn_string

Module conn_string 

Source
Expand description

Connection-string parser shared across reddb, reddb-client, red_client, and every language driver.

Pure function over a string; no I/O, no allocation beyond what the returned ConnectionTarget needs. The grammar is defined by docs/clients/connection-strings.md; this module is the canonical parser and is the single source of truth consumed by the rest of the workspace.

The parser ports the logic that previously lived in drivers/rust/src/connect.rs (which keeps a thin re-export layer for backwards compatibility while drivers migrate over). Cluster URIs (grpc://primary,replica:port), default ports per scheme, and the ?route=primary override behave identically to the original.

Structs§

ConnStringLimits
DoS guardrails applied by parse before any URI work happens.
ParseError
Error returned by parse.

Enums§

ConnectionTarget
Normalised target produced by parse.
ParseErrorKind
Stable error code for parser failures.

Constants§

DEFAULT_PORT_GRPC
DEFAULT_PORT_RED
Default port per documented scheme. Centralised so other crates (the connector, server-side dispatch) can stay consistent.

Functions§

parse
Parse a connection URI into a ConnectionTarget under the default DoS limits.
parse_with_limits
Same as parse but with caller-supplied DoS guardrails. Useful for tests that need tighter limits or for callers (a future admin tool, an offline validator) that need to relax the defaults.