pub struct ConnectOptions {
pub insecure: bool,
pub password: Option<SecretString>,
}Expand description
Backend-agnostic connection options.
password carries a credential the caller already resolved
(env var, OS keyring, interactive prompt, or any host-supplied
source). ferrule-sql performs no credential resolution itself —
it has no dependency on rpassword, an OS keyring, or dirs. An
embedded library consumer supplies the secret here rather than
baking it into the connection URL.
When password is Some, it takes precedence over any password
component embedded in the connection URL. When it is None, each
backend falls back to the URL’s password component, so callers
that prefer to embed the password in the URL keep working.
The secret is wrapped in SecretString so it is redacted in
Debug output and zeroized on drop.
Fields§
§insecure: boolDisable TLS certificate verification. Emits a warning on stderr.
password: Option<SecretString>Caller-resolved credential. Takes precedence over the URL’s
password component; None falls back to the URL.
Implementations§
Source§impl ConnectOptions
impl ConnectOptions
Sourcepub fn effective_password(&self, url: &DatabaseUrl) -> Option<SecretString>
pub fn effective_password(&self, url: &DatabaseUrl) -> Option<SecretString>
Resolve the effective password for this connection: the
caller-supplied ConnectOptions::password if present,
otherwise the password component of url.
This is the single precedence rule every backend honors so the
“resolved secret wins, URL is the fallback” contract lives in
one place. The returned SecretString keeps the credential
redacted and zeroize-on-drop right up to the point each driver
consumes it via expose_secret().
Trait Implementations§
Source§impl Clone for ConnectOptions
impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
fn clone(&self) -> ConnectOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more