pub struct ConnOpts<'a> {
pub engine: Arc<RwLock<Engine>>,
pub tx_gate: TxGate,
pub expected_password: Option<Zeroizing<String>>,
pub users: Arc<UserStore>,
pub shutdown_rx: &'a mut Receiver<bool>,
pub idle_timeout: Duration,
pub query_timeout: Duration,
pub rate_limiter: Option<&'a AuthRateLimiter>,
pub peer_addr: Option<SocketAddr>,
pub metrics: Arc<Metrics>,
pub tx_wait_timeout: Duration,
pub db_name: Option<String>,
}Expand description
Options for a single connection, bundled to keep handle_connection’s
argument list short.
Fields§
§engine: Arc<RwLock<Engine>>§tx_gate: TxGate§expected_password: Option<Zeroizing<String>>Expected client password. Wrapped in Zeroizing so the secret is wiped
from memory on drop (defends against leaking via a core dump).
users: Arc<UserStore>Multi-user store loaded from the data dir at startup. When it has users,
the handshake authenticates (username, password) against it; when empty
the server falls back to expected_password. Shared across connections.
shutdown_rx: &'a mut Receiver<bool>§idle_timeout: Duration§query_timeout: Duration§rate_limiter: Option<&'a AuthRateLimiter>§peer_addr: Option<SocketAddr>§metrics: Arc<Metrics>Shared server metrics. Always present; tests pass Arc::new(Metrics::new()).
tx_wait_timeout: DurationHow long an explicit begin waits to acquire the transaction gate while
another connection holds an open explicit transaction, before giving up
with a clear timeout error instead of queueing indefinitely.
db_name: Option<String>When Some, the single database name this server serves. A CONNECT that
explicitly names a different database is rejected at connect time.
None accepts any name (0.9.x behavior) and only warns.