pub struct ValkeyConfig { /* private fields */ }Expand description
Validated Valkey client configuration.
Implementations§
Source§impl ValkeyConfig
impl ValkeyConfig
Sourcepub fn new(input: ValkeyConfigInput) -> ValkeyResult<Self>
pub fn new(input: ValkeyConfigInput) -> ValkeyResult<Self>
Validates and constructs Valkey configuration.
Sourcepub fn from_env_prefix(prefix: &str) -> ValkeyResult<Self>
pub fn from_env_prefix(prefix: &str) -> ValkeyResult<Self>
Builds configuration from process environment variables using a prefix.
For prefix = "EXAMPLE_SEARCH", this reads the required
EXAMPLE_SEARCH_VALKEY_HOST and optional VALKEY_PORT,
VALKEY_DATABASE, VALKEY_USERNAME, VALKEY_PASSWORD,
VALKEY_KEY_PREFIX, VALKEY_TLS_MODE, and bounded connection-manager
policy variables with the same prefix. TLS defaults to required and
plaintext requires the exact allow-plaintext-development value.
Sourcepub const fn username(&self) -> Option<&SecretString>
pub const fn username(&self) -> Option<&SecretString>
Returns the optional ACL username.
Sourcepub const fn password(&self) -> Option<&SecretString>
pub const fn password(&self) -> Option<&SecretString>
Returns the optional password or access token.
Sourcepub fn key_prefix(&self) -> &str
pub fn key_prefix(&self) -> &str
Returns the key namespace prefix.
Sourcepub const fn transport_security(&self) -> ValkeyTransportSecurity
pub const fn transport_security(&self) -> ValkeyTransportSecurity
Returns the transport security policy.
Sourcepub const fn tls_trust(&self) -> &ValkeyTlsTrust
pub const fn tls_trust(&self) -> &ValkeyTlsTrust
Returns the certificate trust policy used for TLS connections.
Sourcepub const fn connection_timeout(&self) -> Duration
pub const fn connection_timeout(&self) -> Duration
Returns the connection establishment deadline.
Sourcepub const fn response_timeout(&self) -> Duration
pub const fn response_timeout(&self) -> Duration
Returns the command response deadline.
Sourcepub const fn retry_attempts(&self) -> u32
pub const fn retry_attempts(&self) -> u32
Returns automatic reconnect attempts.
Sourcepub const fn concurrency_limit(&self) -> u32
pub const fn concurrency_limit(&self) -> u32
Returns the in-flight command ceiling.
Sourcepub const fn pipeline_buffer_size(&self) -> u32
pub const fn pipeline_buffer_size(&self) -> u32
Returns the outbound pipeline queue bound.