Struct fred::types::ConnectionConfig
source · pub struct ConnectionConfig {Show 15 fields
pub connection_timeout: Duration,
pub internal_command_timeout: Duration,
pub cluster_cache_update_delay: Duration,
pub max_command_attempts: u32,
pub max_redirections: u32,
pub unresponsive: UnresponsiveConfig,
pub reconnect_on_auth_error: bool,
pub auto_client_setname: bool,
pub max_command_buffer_len: usize,
pub disable_cluster_health_check: bool,
pub replica: ReplicaConfig,
pub tcp: TcpConfig,
pub reconnect_errors: Vec<ReconnectError>,
pub router_task_queue: Option<TaskQueueHandle>,
pub connection_task_queue: Option<TaskQueueHandle>,
}Expand description
Configuration options related to the creation or management of TCP connection.
Fields§
§connection_timeout: DurationThe timeout to apply when attempting to create a new TCP connection.
This also includes the TLS handshake if using any of the TLS features.
Default: 10 sec
internal_command_timeout: DurationThe timeout to apply when sending internal commands such as AUTH, SELECT, CLUSTER SLOTS, READONLY, etc.
Default: 10 sec
cluster_cache_update_delay: DurationThe amount of time to wait after a MOVED error is received before the client will update the cached cluster
state.
Default: 0
max_command_attempts: u32The maximum number of times the client will attempt to send a command.
This value be incremented whenever the connection closes while the command is in-flight.
Default: 3
max_redirections: u32The maximum number of times the client will attempt to follow a MOVED or ASK redirection per command.
Default: 5
unresponsive: UnresponsiveConfigUnresponsive connection configuration options.
reconnect_on_auth_error: boolAn unexpected NOAUTH error is treated the same as a general connection failure, causing the client to
reconnect based on the ReconnectPolicy. This is recommended if callers are using ElastiCache.
Default: false
auto_client_setname: boolAutomatically send CLIENT SETNAME on each connection associated with a client instance.
Default: false
max_command_buffer_len: usizeLimit the size of the internal in-memory command queue.
Commands that exceed this limit will receive a RedisErrorKind::Backpressure error.
See command_queue_len for more information.
Default: 0 (unlimited)
disable_cluster_health_check: boolDisable the CLUSTER INFO health check when initializing cluster connections.
Default: false
replica: ReplicaConfigreplicas only.Configuration options for replica nodes.
Default: None
tcp: TcpConfigTCP connection options.
reconnect_errors: Vec<ReconnectError>custom-reconnect-errors only.Errors that should trigger reconnection logic.
router_task_queue: Option<TaskQueueHandle>glommio only.The task queue onto which routing tasks will be spawned.
May cause a panic if spawn_local_into fails.
connection_task_queue: Option<TaskQueueHandle>glommio only.The task queue onto which connection reader tasks will be spawned.
May cause a panic if spawn_local_into fails.
Trait Implementations§
source§impl Clone for ConnectionConfig
impl Clone for ConnectionConfig
source§fn clone(&self) -> ConnectionConfig
fn clone(&self) -> ConnectionConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for ConnectionConfig
impl Debug for ConnectionConfig
source§impl Default for ConnectionConfig
impl Default for ConnectionConfig
source§impl PartialEq for ConnectionConfig
impl PartialEq for ConnectionConfig
impl Eq for ConnectionConfig
impl StructuralPartialEq for ConnectionConfig
Auto Trait Implementations§
impl Freeze for ConnectionConfig
impl !RefUnwindSafe for ConnectionConfig
impl !Send for ConnectionConfig
impl !Sync for ConnectionConfig
impl Unpin for ConnectionConfig
impl !UnwindSafe for ConnectionConfig
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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