pub struct RedisConfig {
pub uri: String,
pub response_timeout: Option<u64>,
pub connection_timeout: Option<u64>,
pub number_of_retries: Option<usize>,
pub exponent_base: Option<u64>,
pub factor: Option<u64>,
pub max_delay: Option<u64>,
}
Fields§
§uri: String
The URI for connecting to the Redis server. For example: redis://127.0.0.1/
response_timeout: Option<u64>
The new connection will time out operations after response_timeout
has passed.
connection_timeout: Option<u64>
Each connection attempt to the server will time out after connection_timeout
.
number_of_retries: Option<usize>
number_of_retries times, with an exponentially increasing delay
exponent_base: Option<u64>
The resulting duration is calculated by taking the base to the n
-th power,
where n
denotes the number of past attempts.
factor: Option<u64>
A multiplicative factor that will be applied to the retry delay.
For example, using a factor of 1000
will make each delay in units of seconds.
max_delay: Option<u64>
Apply a maximum delay between connection attempts. The delay between attempts won’t be longer than max_delay milliseconds.
Trait Implementations§
Source§impl Clone for RedisConfig
impl Clone for RedisConfig
Source§fn clone(&self) -> RedisConfig
fn clone(&self) -> RedisConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Configurable for RedisConfig
impl Configurable for RedisConfig
Source§fn config_prefix() -> &'static str
fn config_prefix() -> &'static str
Prefix used to read toml configuration.
If you need to load external configuration, you need to rewrite this method
Source§impl Debug for RedisConfig
impl Debug for RedisConfig
Source§impl<'de> Deserialize<'de> for RedisConfig
impl<'de> Deserialize<'de> for RedisConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for RedisConfig
impl JsonSchema for RedisConfig
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moreAuto Trait Implementations§
impl Freeze for RedisConfig
impl RefUnwindSafe for RedisConfig
impl Send for RedisConfig
impl Sync for RedisConfig
impl Unpin for RedisConfig
impl UnwindSafe for RedisConfig
Blanket Implementations§
Source§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
Mutably borrows from an owned value. Read more