pub struct RedisEndpointConfig {
pub host: Option<String>,
pub port: Option<u16>,
pub command: RedisCommand,
pub channels: Vec<String>,
pub key: Option<String>,
pub timeout: u64,
pub password: Option<String>,
pub db: u8,
}Expand description
Configuration parsed from a Redis URI.
Format: redis://host:port?command=GET&... or redis://?command=GET (no host/port)
§Fields with Global Defaults (Option)
These fields can be set via global defaults in Camel.toml. They are Option<T>
to distinguish between “not set by URI” (None) and “explicitly set by URI” (Some(v)).
After calling apply_defaults() + resolve_defaults(), all are guaranteed Some.
host- Redis server hostnameport- Redis server port
§Fields Without Global Defaults
These fields are per-endpoint only and have no global defaults:
command- Redis command to execute (default: SET)channels- Channels for pub/sub operations (default: empty)key- Key for operations that require it (default: None)timeout- Timeout in seconds for blocking operations (default: 1)password- Redis password for authentication (default: None)db- Redis database number (default: 0)
Fields§
§host: Option<String>Redis server hostname. None if not set in URI.
Filled by apply_defaults() from global config, then resolve_defaults().
port: Option<u16>Redis server port. None if not set in URI.
Filled by apply_defaults() from global config, then resolve_defaults().
command: RedisCommandRedis command to execute. Default: SET.
channels: Vec<String>Channels for pub/sub operations. Default: empty.
key: Option<String>Key for operations that require it. Default: None.
timeout: u64Timeout in seconds for blocking operations. Default: 1.
password: Option<String>Redis password for authentication. Default: None.
db: u8Redis database number. Default: 0.
Implementations§
Source§impl RedisEndpointConfig
impl RedisEndpointConfig
pub fn from_uri(uri: &str) -> Result<Self, CamelError>
Sourcepub fn apply_defaults(&mut self, defaults: &RedisConfig)
pub fn apply_defaults(&mut self, defaults: &RedisConfig)
Apply global defaults to any None fields.
This method fills in default values from the provided RedisConfig for
fields that are None (not set in URI). It’s intended to be called after
parsing a URI when global component defaults should be applied.
Sourcepub fn resolve_defaults(&mut self)
pub fn resolve_defaults(&mut self)
Resolve any remaining None fields to hardcoded defaults.
This should be called after apply_defaults() to ensure all fields
that can have global defaults are guaranteed to be Some.
Trait Implementations§
Source§impl Clone for RedisEndpointConfig
impl Clone for RedisEndpointConfig
Source§fn clone(&self) -> RedisEndpointConfig
fn clone(&self) -> RedisEndpointConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more