pub struct ValkeyConfig {
pub endpoint: String,
pub tls: bool,
pub username: Option<String>,
pub password: Option<String>,
pub key_prefix: String,
pub ttl_seconds: Option<u64>,
pub max_session_lifetime_seconds: Option<u64>,
pub connect_timeout_ms: u64,
pub command_timeout_ms: u64,
}Expand description
Parsed global.apl.session_store config for kind: valkey.
Unknown keys (including kind, consumed by the factory dispatch) are
ignored so the same block can carry the discriminator.
Fields§
§endpoint: StringEndpoint: a redis:// / rediss:// URL or a bare host:port.
tls: boolWhether to use TLS. Implied true for a rediss:// endpoint.
Required for any non-localhost endpoint (validated).
username: Option<String>Optional ACL username (Valkey 6+ ACLs). Paired with password.
password: Option<String>Optional auth password / ACL secret. Sourced from config/env by the operator; never hard-coded.
key_prefix: StringKey prefix/namespace for label keys.
ttl_seconds: Option<u64>Sliding TTL in seconds, refreshed on load and append. None
(default) means no expiry.
max_session_lifetime_seconds: Option<u64>Declared maximum session-identity lifetime, used only to emit the
TTL-soundness warning when ttl_seconds is shorter.
connect_timeout_ms: u64Connection acquisition timeout (ms).
command_timeout_ms: u64Per-command response timeout (ms) — the fail-closed hot-path knob.
Implementations§
Source§impl ValkeyConfig
impl ValkeyConfig
Sourcepub fn from_value(value: &Value) -> Result<ValkeyConfig, BuildError>
pub fn from_value(value: &Value) -> Result<ValkeyConfig, BuildError>
Parse from the YAML config block, then validate.
§Errors
Returns BuildError when the block does not deserialize, or when
validation rejects it: a non-localhost endpoint without TLS,
contradictory credentials, or a TTL too large to express as an expiry.
Sourcepub fn tls_enabled(&self) -> bool
pub fn tls_enabled(&self) -> bool
TLS is on when explicitly set or implied by a rediss:// scheme.
Sourcepub fn connection_url(&self) -> Result<String, BuildError>
pub fn connection_url(&self) -> Result<String, BuildError>
Build the redis/rediss connection URL deadpool consumes.
Credentials are percent-encoded via the url crate (never naive
string interpolation), and the wire scheme always reflects
Self::tls_enabled so it cannot disagree with the validated TLS
intent. A fully-formed endpoint URL is parsed (and trusted for its
own embedded credentials); a bare host:port is assembled with
the configured scheme and any separate username/password.
§Errors
Returns BuildError::Config when the endpoint is not a valid URL or
cannot carry the configured credentials. The endpoint is redacted in the
message, so a password in the URL is never disclosed.
Trait Implementations§
Source§impl Clone for ValkeyConfig
impl Clone for ValkeyConfig
Source§fn clone(&self) -> ValkeyConfig
fn clone(&self) -> ValkeyConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ValkeyConfig
impl Debug for ValkeyConfig
Source§impl<'de> Deserialize<'de> for ValkeyConfig
impl<'de> Deserialize<'de> for ValkeyConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ValkeyConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ValkeyConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ValkeyConfig
impl RefUnwindSafe for ValkeyConfig
impl Send for ValkeyConfig
impl Sync for ValkeyConfig
impl Unpin for ValkeyConfig
impl UnsafeUnpin for ValkeyConfig
impl UnwindSafe for ValkeyConfig
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointerSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more