Struct fred::clients::SentinelClient
source · pub struct SentinelClient { /* private fields */ }Available on crate feature
sentinel-client only.Expand description
A struct for interacting directly with Sentinel nodes.
This struct will not communicate with Redis servers behind the sentinel interface, but rather with the sentinel nodes themselves. Callers should use the RedisClient interface with a ServerConfig::Sentinel for interacting with Redis services behind a sentinel layer.
See the sentinel API docs for more information.
Implementations§
source§impl SentinelClient
impl SentinelClient
sourcepub fn new(
config: SentinelConfig,
perf: Option<PerformanceConfig>,
connection: Option<ConnectionConfig>,
policy: Option<ReconnectPolicy>,
) -> SentinelClient
pub fn new( config: SentinelConfig, perf: Option<PerformanceConfig>, connection: Option<ConnectionConfig>, policy: Option<ReconnectPolicy>, ) -> SentinelClient
Create a new client instance without connecting to the sentinel node.
See the builder interface for more information.
Trait Implementations§
source§impl AclInterface for SentinelClient
Available on crate feature i-acl only.
impl AclInterface for SentinelClient
Available on crate feature
i-acl only.source§fn acl_setuser<S, V>(
&self,
username: S,
rules: V,
) -> impl Future<Output = RedisResult<()>>
fn acl_setuser<S, V>( &self, username: S, rules: V, ) -> impl Future<Output = RedisResult<()>>
Create an ACL user with the specified rules or modify the rules of an existing user. Read more
source§fn acl_load(&self) -> impl Future<Output = RedisResult<()>>
fn acl_load(&self) -> impl Future<Output = RedisResult<()>>
When Redis is configured to use an ACL file (with the aclfile configuration option), this command will reload
the ACLs from the file, replacing all the current ACL rules with the ones defined in the file. Read more
source§fn acl_save(&self) -> impl Future<Output = RedisResult<()>>
fn acl_save(&self) -> impl Future<Output = RedisResult<()>>
When Redis is configured to use an ACL file (with the aclfile configuration option), this command will save the
currently defined ACLs from the server memory to the ACL file. Read more
source§fn acl_list<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn acl_list<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
The command shows the currently active ACL rules in the Redis server. Read more
source§fn acl_users<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn acl_users<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
The command shows a list of all the usernames of the currently configured users in the Redis ACL system. Read more
source§fn acl_getuser<R, S>(&self, username: S) -> impl Future<Output = RedisResult<R>>
fn acl_getuser<R, S>(&self, username: S) -> impl Future<Output = RedisResult<R>>
The command returns all the rules defined for an existing ACL user. Read more
source§fn acl_deluser<R, S>(
&self,
usernames: S,
) -> impl Future<Output = RedisResult<R>>
fn acl_deluser<R, S>( &self, usernames: S, ) -> impl Future<Output = RedisResult<R>>
Delete all the specified ACL users and terminate all the connections that are authenticated with such users. Read more
source§fn acl_cat<R>(
&self,
category: Option<Str>,
) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn acl_cat<R>(
&self,
category: Option<Str>,
) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
The command shows the available ACL categories if called without arguments. If a category name is given,
the command shows all the Redis commands in the specified category. Read more
source§fn acl_genpass<R>(
&self,
bits: Option<u16>,
) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn acl_genpass<R>(
&self,
bits: Option<u16>,
) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
Generate a password with length
bits, returning the password. Read moresource§fn acl_whoami<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn acl_whoami<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
Return the username the current connection is authenticated with. New connections are authenticated
with the “default” user. Read more
source§fn acl_log_count<R>(
&self,
count: Option<u32>,
) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn acl_log_count<R>(
&self,
count: Option<u32>,
) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
Read
count recent ACL security events. Read moresource§fn acl_log_reset(&self) -> impl Future<Output = RedisResult<()>>
fn acl_log_reset(&self) -> impl Future<Output = RedisResult<()>>
Clear the ACL security events logs. Read more
source§impl AuthInterface for SentinelClient
impl AuthInterface for SentinelClient
source§fn auth<S>(
&self,
username: Option<String>,
password: S,
) -> impl Future<Output = RedisResult<()>>where
S: Into<Str>,
fn auth<S>(
&self,
username: Option<String>,
password: S,
) -> impl Future<Output = RedisResult<()>>where
S: Into<Str>,
Request for authentication in a password-protected Redis server. Returns ok if successful. Read more
source§fn hello(
&self,
version: RespVersion,
auth: Option<(Str, Str)>,
setname: Option<Str>,
) -> impl Future<Output = RedisResult<()>>
fn hello( &self, version: RespVersion, auth: Option<(Str, Str)>, setname: Option<Str>, ) -> impl Future<Output = RedisResult<()>>
Switch to a different protocol, optionally authenticating in the process. Read more
source§impl ClientInterface for SentinelClient
Available on crate feature i-client only.
impl ClientInterface for SentinelClient
Available on crate feature
i-client only.source§fn client_id<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn client_id<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
Return the ID of the current connection. Read more
source§fn connection_ids(&self) -> impl Future<Output = HashMap<Server, i64>>
fn connection_ids(&self) -> impl Future<Output = HashMap<Server, i64>>
Read the connection IDs for the active connections to each server. Read more
source§fn client_info<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn client_info<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
The command returns information and statistics about the current client connection in a mostly human readable
format. Read more
source§fn client_kill<R>(
&self,
filters: Vec<ClientKillFilter>,
) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn client_kill<R>(
&self,
filters: Vec<ClientKillFilter>,
) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
Close a given connection or set of connections. Read more
source§fn client_list<R, I>(
&self,
type: Option<ClientKillType>,
ids: Option<Vec<String>>,
) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn client_list<R, I>(
&self,
type: Option<ClientKillType>,
ids: Option<Vec<String>>,
) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
The CLIENT LIST command returns information and statistics about the client connections server in a mostly human
readable format. Read more
source§fn client_getname<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn client_getname<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
The CLIENT GETNAME returns the name of the current connection as set by CLIENT SETNAME. Read more
source§fn client_setname<S>(&self, name: S) -> impl Future<Output = RedisResult<()>>where
S: Into<Str>,
fn client_setname<S>(&self, name: S) -> impl Future<Output = RedisResult<()>>where
S: Into<Str>,
Assign a name to the current connection. Read more
source§fn client_pause(
&self,
timeout: i64,
mode: Option<ClientPauseKind>,
) -> impl Future<Output = RedisResult<()>>
fn client_pause( &self, timeout: i64, mode: Option<ClientPauseKind>, ) -> impl Future<Output = RedisResult<()>>
CLIENT PAUSE is a connections control command able to suspend all the Redis clients for the specified amount of
time (in milliseconds). Read more
source§fn client_unpause(&self) -> impl Future<Output = RedisResult<()>>
fn client_unpause(&self) -> impl Future<Output = RedisResult<()>>
CLIENT UNPAUSE is used to resume command processing for all clients that were paused by CLIENT PAUSE. Read more
source§fn client_reply(
&self,
flag: ClientReplyFlag,
) -> impl Future<Output = RedisResult<()>>
fn client_reply( &self, flag: ClientReplyFlag, ) -> impl Future<Output = RedisResult<()>>
The CLIENT REPLY command controls whether the server will reply the client’s commands. The following modes are
available: Read more
source§fn client_unblock<R, S>(
&self,
id: S,
flag: Option<ClientUnblockFlag>,
) -> impl Future<Output = RedisResult<R>>
fn client_unblock<R, S>( &self, id: S, flag: Option<ClientUnblockFlag>, ) -> impl Future<Output = RedisResult<R>>
This command can unblock, from a different connection, a client blocked in a blocking operation, such as for
instance BRPOP or XREAD or WAIT. Read more
source§fn unblock_self(
&self,
flag: Option<ClientUnblockFlag>,
) -> impl Future<Output = RedisResult<()>>
fn unblock_self( &self, flag: Option<ClientUnblockFlag>, ) -> impl Future<Output = RedisResult<()>>
A convenience function to unblock any blocked connection on this client.
source§fn client_tracking<R, T, P>(
&self,
toggle: T,
redirect: Option<i64>,
prefixes: P,
bcast: bool,
optin: bool,
optout: bool,
noloop: bool,
) -> impl Future<Output = RedisResult<R>>
fn client_tracking<R, T, P>( &self, toggle: T, redirect: Option<i64>, prefixes: P, bcast: bool, optin: bool, optout: bool, noloop: bool, ) -> impl Future<Output = RedisResult<R>>
Available on crate feature
i-tracking only.This command enables the tracking feature of the Redis server that is used for server assisted client side
caching. Read more
source§fn client_trackinginfo<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn client_trackinginfo<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
Available on crate feature
i-tracking only.The command returns information about the current client connection’s use of the server assisted client side
caching feature. Read more
source§fn client_getredir<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn client_getredir<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
Available on crate feature
i-tracking only.This command returns the client ID we are redirecting our tracking notifications to. Read more
source§fn client_caching<R>(
&self,
enabled: bool,
) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn client_caching<R>(
&self,
enabled: bool,
) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
Available on crate feature
i-tracking only.This command controls the tracking of the keys in the next command executed by the connection, when tracking is
enabled in OPTIN or OPTOUT mode. Read more
source§impl ClientLike for SentinelClient
impl ClientLike for SentinelClient
source§fn client_config(&self) -> RedisConfig
fn client_config(&self) -> RedisConfig
Read the config used to initialize the client.
source§fn client_reconnect_policy(&self) -> Option<ReconnectPolicy>
fn client_reconnect_policy(&self) -> Option<ReconnectPolicy>
Read the reconnect policy used to initialize the client.
source§fn connection_config(&self) -> &ConnectionConfig
fn connection_config(&self) -> &ConnectionConfig
Read the connection config used to initialize the client.
source§fn protocol_version(&self) -> RespVersion
fn protocol_version(&self) -> RespVersion
Read the RESP version used by the client when communicating with the server.
source§fn has_reconnect_policy(&self) -> bool
fn has_reconnect_policy(&self) -> bool
Whether the client has a reconnection policy.
source§fn is_pipelined(&self) -> bool
fn is_pipelined(&self) -> bool
Whether the client will automatically pipeline commands.
source§fn is_clustered(&self) -> bool
fn is_clustered(&self) -> bool
Whether the client is connected to a cluster.
source§fn uses_sentinels(&self) -> bool
fn uses_sentinels(&self) -> bool
Whether the client uses the sentinel interface.
source§fn update_perf_config(&self, config: PerformanceConfig)
fn update_perf_config(&self, config: PerformanceConfig)
Update the internal PerformanceConfig in place with new values.
source§fn perf_config(&self) -> PerformanceConfig
fn perf_config(&self) -> PerformanceConfig
Read the PerformanceConfig associated with this client.
source§fn state(&self) -> ClientState
fn state(&self) -> ClientState
Read the state of the underlying connection(s). Read more
source§fn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Whether all underlying connections are healthy.
source§fn active_connections(
&self,
) -> impl Future<Output = Result<Vec<Server>, RedisError>>
fn active_connections( &self, ) -> impl Future<Output = Result<Vec<Server>, RedisError>>
Read the set of active connections managed by the client.
source§fn server_version(&self) -> Option<Version>
fn server_version(&self) -> Option<Version>
Read the server version, if known.
source§fn set_resolver(&self, resolver: Rc<dyn Resolve>) -> impl Future
fn set_resolver(&self, resolver: Rc<dyn Resolve>) -> impl Future
Available on crate feature
dns only.Override the DNS resolution logic for the client.
source§fn connect(&self) -> ConnectHandle
fn connect(&self) -> ConnectHandle
Connect to the server. Read more
source§fn force_reconnection(&self) -> impl Future<Output = RedisResult<()>>
fn force_reconnection(&self) -> impl Future<Output = RedisResult<()>>
Force a reconnection to the server(s). Read more
source§fn wait_for_connect(&self) -> impl Future<Output = RedisResult<()>>
fn wait_for_connect(&self) -> impl Future<Output = RedisResult<()>>
Wait for the result of the next connection attempt. Read more
source§fn init(&self) -> impl Future<Output = RedisResult<ConnectHandle>>
fn init(&self) -> impl Future<Output = RedisResult<ConnectHandle>>
Initialize a new routing and connection task and wait for it to connect successfully. Read more
source§fn quit(&self) -> impl Future<Output = RedisResult<()>>
fn quit(&self) -> impl Future<Output = RedisResult<()>>
Close the connection to the Redis server. The returned future resolves when the command has been written to the
socket, not when the connection has been fully closed. Some time after this future resolves the future
returned by connect will resolve which indicates that the connection has been fully closed. Read more
source§fn shutdown(
&self,
flags: Option<ShutdownFlags>,
) -> impl Future<Output = RedisResult<()>>
fn shutdown( &self, flags: Option<ShutdownFlags>, ) -> impl Future<Output = RedisResult<()>>
Available on crate feature
i-server only.Shut down the server and quit the client. Read more
source§fn flushall<R>(&self, async: bool) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn flushall<R>(&self, async: bool) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
Delete the keys in all databases. Read more
source§fn flushall_cluster(&self) -> impl Future<Output = RedisResult<()>>
fn flushall_cluster(&self) -> impl Future<Output = RedisResult<()>>
Delete the keys on all nodes in the cluster. This is a special function that does not map directly to the Redis
interface.
source§fn ping<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn ping<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
Ping the Redis server. Read more
source§fn info<R>(
&self,
section: Option<InfoKind>,
) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn info<R>(
&self,
section: Option<InfoKind>,
) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
Read info about the server. Read more
source§fn custom<R, T>(
&self,
cmd: CustomCommand,
args: Vec<T>,
) -> impl Future<Output = RedisResult<R>>
fn custom<R, T>( &self, cmd: CustomCommand, args: Vec<T>, ) -> impl Future<Output = RedisResult<R>>
Run a custom command that is not yet supported via another interface on this client. This is most useful when
interacting with third party modules or extensions. Read more
source§fn custom_raw<T>(
&self,
cmd: CustomCommand,
args: Vec<T>,
) -> impl Future<Output = RedisResult<Resp3Frame>>
fn custom_raw<T>( &self, cmd: CustomCommand, args: Vec<T>, ) -> impl Future<Output = RedisResult<Resp3Frame>>
source§fn with_options(&self, options: &Options) -> WithOptions<Self>
fn with_options(&self, options: &Options) -> WithOptions<Self>
Customize various configuration options on commands.
source§impl Clone for SentinelClient
impl Clone for SentinelClient
source§fn clone(&self) -> SentinelClient
fn clone(&self) -> SentinelClient
Returns a copy 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 Debug for SentinelClient
impl Debug for SentinelClient
source§impl EventInterface for SentinelClient
impl EventInterface for SentinelClient
source§fn on_message<F>(&self, func: F) -> JoinHandle<RedisResult<()>>
fn on_message<F>(&self, func: F) -> JoinHandle<RedisResult<()>>
Spawn a task that runs the provided function on each publish-subscribe message. Read more
source§fn on_keyspace_event<F>(&self, func: F) -> JoinHandle<RedisResult<()>>
fn on_keyspace_event<F>(&self, func: F) -> JoinHandle<RedisResult<()>>
Spawn a task that runs the provided function on each keyspace event. Read more
source§fn on_reconnect<F>(&self, func: F) -> JoinHandle<RedisResult<()>>
fn on_reconnect<F>(&self, func: F) -> JoinHandle<RedisResult<()>>
Spawn a task that runs the provided function on each reconnection event. Read more
source§fn on_cluster_change<F>(&self, func: F) -> JoinHandle<RedisResult<()>>
fn on_cluster_change<F>(&self, func: F) -> JoinHandle<RedisResult<()>>
Spawn a task that runs the provided function on each cluster change event. Read more
source§fn on_error<F>(&self, func: F) -> JoinHandle<RedisResult<()>>
fn on_error<F>(&self, func: F) -> JoinHandle<RedisResult<()>>
Spawn a task that runs the provided function on each connection error event. Read more
source§fn on_unresponsive<F>(&self, func: F) -> JoinHandle<RedisResult<()>>
fn on_unresponsive<F>(&self, func: F) -> JoinHandle<RedisResult<()>>
Spawn a task that runs the provided function whenever the client detects an unresponsive connection.
source§fn on_any<Fe, Fr, Fc>(
&self,
error_fn: Fe,
reconnect_fn: Fr,
cluster_change_fn: Fc,
) -> JoinHandle<RedisResult<()>>where
Fe: Fn(RedisError) -> RedisResult<()> + 'static,
Fr: Fn(Server) -> RedisResult<()> + 'static,
Fc: Fn(Vec<ClusterStateChange>) -> RedisResult<()> + 'static,
fn on_any<Fe, Fr, Fc>(
&self,
error_fn: Fe,
reconnect_fn: Fr,
cluster_change_fn: Fc,
) -> JoinHandle<RedisResult<()>>where
Fe: Fn(RedisError) -> RedisResult<()> + 'static,
Fr: Fn(Server) -> RedisResult<()> + 'static,
Fc: Fn(Vec<ClusterStateChange>) -> RedisResult<()> + 'static,
Spawn one task that listens for all connection management event types. Read more
source§fn message_rx(&self) -> BroadcastReceiver<Message>
fn message_rx(&self) -> BroadcastReceiver<Message>
Listen for messages on the publish-subscribe interface. Read more
source§fn keyspace_event_rx(&self) -> BroadcastReceiver<KeyspaceEvent>
fn keyspace_event_rx(&self) -> BroadcastReceiver<KeyspaceEvent>
Listen for keyspace and keyevent notifications on the publish-subscribe interface. Read more
source§fn reconnect_rx(&self) -> BroadcastReceiver<Server>
fn reconnect_rx(&self) -> BroadcastReceiver<Server>
Listen for reconnection notifications. Read more
source§fn cluster_change_rx(&self) -> BroadcastReceiver<Vec<ClusterStateChange>>
fn cluster_change_rx(&self) -> BroadcastReceiver<Vec<ClusterStateChange>>
Listen for notifications whenever the cluster state changes. Read more
source§fn error_rx(&self) -> BroadcastReceiver<RedisError>
fn error_rx(&self) -> BroadcastReceiver<RedisError>
Listen for protocol and connection errors. This stream can be used to more intelligently handle errors that may
not appear in the request-response cycle, and so cannot be handled by response futures.
source§fn unresponsive_rx(&self) -> BroadcastReceiver<Server>
fn unresponsive_rx(&self) -> BroadcastReceiver<Server>
Receive a message when the client initiates a reconnection after detecting an unresponsive connection.
source§impl HeartbeatInterface for SentinelClient
Available on crate feature i-server only.
impl HeartbeatInterface for SentinelClient
Available on crate feature
i-server only.source§fn enable_heartbeat(
&self,
interval: Duration,
break_on_error: bool,
) -> impl Future<Output = RedisResult<()>>
fn enable_heartbeat( &self, interval: Duration, break_on_error: bool, ) -> impl Future<Output = RedisResult<()>>
Return a future that will ping the server on an interval.
source§impl MetricsInterface for SentinelClient
impl MetricsInterface for SentinelClient
source§fn read_redelivery_count(&self) -> usize
fn read_redelivery_count(&self) -> usize
Read the number of request redeliveries. Read more
source§fn take_redelivery_count(&self) -> usize
fn take_redelivery_count(&self) -> usize
Read and reset the number of request redeliveries.
source§fn command_queue_len(&self) -> usize
fn command_queue_len(&self) -> usize
Read the number of buffered commands that have not yet been sent to the server.
source§fn read_latency_metrics(&self) -> Stats
fn read_latency_metrics(&self) -> Stats
Available on crate feature
metrics only.Read latency metrics across all commands. Read more
source§fn take_latency_metrics(&self) -> Stats
fn take_latency_metrics(&self) -> Stats
Available on crate feature
metrics only.Read and consume latency metrics, resetting their values afterwards.
source§fn read_network_latency_metrics(&self) -> Stats
fn read_network_latency_metrics(&self) -> Stats
Available on crate feature
metrics only.Read network latency metrics across all commands. Read more
source§fn take_network_latency_metrics(&self) -> Stats
fn take_network_latency_metrics(&self) -> Stats
Available on crate feature
metrics only.Read and consume network latency metrics, resetting their values afterwards.
source§fn read_req_size_metrics(&self) -> Stats
fn read_req_size_metrics(&self) -> Stats
Available on crate feature
metrics only.Read request payload size metrics across all commands.
source§fn take_req_size_metrics(&self) -> Stats
fn take_req_size_metrics(&self) -> Stats
Available on crate feature
metrics only.Read and consume request payload size metrics, resetting their values afterwards.
source§fn read_res_size_metrics(&self) -> Stats
fn read_res_size_metrics(&self) -> Stats
Available on crate feature
metrics only.Read response payload size metrics across all commands.
source§fn take_res_size_metrics(&self) -> Stats
fn take_res_size_metrics(&self) -> Stats
Available on crate feature
metrics only.Read and consume response payload size metrics, resetting their values afterwards.
source§impl PubsubInterface for SentinelClient
Available on crate feature i-pubsub only.
impl PubsubInterface for SentinelClient
Available on crate feature
i-pubsub only.source§fn subscribe<S>(&self, channels: S) -> impl Future<Output = RedisResult<()>>where
S: Into<MultipleStrings>,
fn subscribe<S>(&self, channels: S) -> impl Future<Output = RedisResult<()>>where
S: Into<MultipleStrings>,
Subscribe to a channel on the publish-subscribe interface. Read more
source§fn unsubscribe<S>(&self, channels: S) -> impl Future<Output = RedisResult<()>>where
S: Into<MultipleStrings>,
fn unsubscribe<S>(&self, channels: S) -> impl Future<Output = RedisResult<()>>where
S: Into<MultipleStrings>,
Unsubscribe from a channel on the PubSub interface. Read more
source§fn psubscribe<S>(&self, patterns: S) -> impl Future<Output = RedisResult<()>>where
S: Into<MultipleStrings>,
fn psubscribe<S>(&self, patterns: S) -> impl Future<Output = RedisResult<()>>where
S: Into<MultipleStrings>,
Subscribes the client to the given patterns. Read more
source§fn punsubscribe<S>(&self, patterns: S) -> impl Future<Output = RedisResult<()>>where
S: Into<MultipleStrings>,
fn punsubscribe<S>(&self, patterns: S) -> impl Future<Output = RedisResult<()>>where
S: Into<MultipleStrings>,
Unsubscribes the client from the given patterns, or from all of them if none is given. Read more
source§fn publish<R, S, V>(
&self,
channel: S,
message: V,
) -> impl Future<Output = RedisResult<R>>
fn publish<R, S, V>( &self, channel: S, message: V, ) -> impl Future<Output = RedisResult<R>>
Publish a message on the PubSub interface, returning the number of clients that received the message. Read more
source§fn ssubscribe<C>(&self, channels: C) -> impl Future<Output = RedisResult<()>>where
C: Into<MultipleStrings>,
fn ssubscribe<C>(&self, channels: C) -> impl Future<Output = RedisResult<()>>where
C: Into<MultipleStrings>,
Subscribes the client to the specified shard channels. Read more
source§fn sunsubscribe<C>(&self, channels: C) -> impl Future<Output = RedisResult<()>>where
C: Into<MultipleStrings>,
fn sunsubscribe<C>(&self, channels: C) -> impl Future<Output = RedisResult<()>>where
C: Into<MultipleStrings>,
Unsubscribes the client from the given shard channels, or from all of them if none is given. Read more
source§fn spublish<R, S, V>(
&self,
channel: S,
message: V,
) -> impl Future<Output = RedisResult<R>>
fn spublish<R, S, V>( &self, channel: S, message: V, ) -> impl Future<Output = RedisResult<R>>
Posts a message to the given shard channel. Read more
source§fn pubsub_channels<R, S>(
&self,
pattern: S,
) -> impl Future<Output = RedisResult<R>>
fn pubsub_channels<R, S>( &self, pattern: S, ) -> impl Future<Output = RedisResult<R>>
Lists the currently active channels. Read more
source§fn pubsub_numpat<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn pubsub_numpat<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
Returns the number of unique patterns that are subscribed to by clients. Read more
source§fn pubsub_numsub<R, S>(
&self,
channels: S,
) -> impl Future<Output = RedisResult<R>>
fn pubsub_numsub<R, S>( &self, channels: S, ) -> impl Future<Output = RedisResult<R>>
Returns the number of subscribers (exclusive of clients subscribed to patterns) for the specified channels. Read more
source§fn pubsub_shardchannels<R, S>(
&self,
pattern: S,
) -> impl Future<Output = RedisResult<R>>
fn pubsub_shardchannels<R, S>( &self, pattern: S, ) -> impl Future<Output = RedisResult<R>>
Lists the currently active shard channels. Read more
source§fn pubsub_shardnumsub<R, S>(
&self,
channels: S,
) -> impl Future<Output = RedisResult<R>>
fn pubsub_shardnumsub<R, S>( &self, channels: S, ) -> impl Future<Output = RedisResult<R>>
Returns the number of subscribers for the specified shard channels. Read more
source§impl SentinelInterface for SentinelClient
impl SentinelInterface for SentinelClient
source§fn ckquorum<R, N>(&self, name: N) -> impl Future<Output = RedisResult<R>>
fn ckquorum<R, N>(&self, name: N) -> impl Future<Output = RedisResult<R>>
Check if the current Sentinel configuration is able to reach the quorum needed to failover a master, and the
majority needed to authorize the failover.
source§fn flushconfig<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn flushconfig<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
Force Sentinel to rewrite its configuration on disk, including the current Sentinel state.
source§fn failover<R, N>(&self, name: N) -> impl Future<Output = RedisResult<R>>
fn failover<R, N>(&self, name: N) -> impl Future<Output = RedisResult<R>>
Force a failover as if the master was not reachable, and without asking for agreement to other Sentinels.
source§fn get_master_addr_by_name<R, N>(
&self,
name: N,
) -> impl Future<Output = RedisResult<R>>
fn get_master_addr_by_name<R, N>( &self, name: N, ) -> impl Future<Output = RedisResult<R>>
Return the ip and port number of the master with that name.
source§fn info_cache<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn info_cache<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
Return cached INFO output from masters and replicas.
source§fn master<R, N>(&self, name: N) -> impl Future<Output = RedisResult<R>>
fn master<R, N>(&self, name: N) -> impl Future<Output = RedisResult<R>>
Show the state and info of the specified master.
source§fn masters<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn masters<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
Show a list of monitored masters and their state.
source§fn monitor<R, N>(
&self,
name: N,
ip: IpAddr,
port: u16,
quorum: u32,
) -> impl Future<Output = RedisResult<R>>
fn monitor<R, N>( &self, name: N, ip: IpAddr, port: u16, quorum: u32, ) -> impl Future<Output = RedisResult<R>>
Start Sentinel’s monitoring. Read more
source§fn myid<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn myid<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
Return the ID of the Sentinel instance.
source§fn pending_scripts<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn pending_scripts<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
This command returns information about pending scripts.
source§fn remove<R, N>(&self, name: N) -> impl Future<Output = RedisResult<R>>
fn remove<R, N>(&self, name: N) -> impl Future<Output = RedisResult<R>>
Stop Sentinel’s monitoring. Read more
source§fn replicas<R, N>(&self, name: N) -> impl Future<Output = RedisResult<R>>
fn replicas<R, N>(&self, name: N) -> impl Future<Output = RedisResult<R>>
Show a list of replicas for this master, and their state.
source§fn sentinels<R, N>(&self, name: N) -> impl Future<Output = RedisResult<R>>
fn sentinels<R, N>(&self, name: N) -> impl Future<Output = RedisResult<R>>
Show a list of sentinel instances for this master, and their state.
source§fn set<R, N, V>(&self, name: N, args: V) -> impl Future<Output = RedisResult<R>>
fn set<R, N, V>(&self, name: N, args: V) -> impl Future<Output = RedisResult<R>>
Set Sentinel’s monitoring configuration. Read more
source§fn simulate_failure<R>(
&self,
kind: SentinelFailureKind,
) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn simulate_failure<R>(
&self,
kind: SentinelFailureKind,
) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
This command simulates different Sentinel crash scenarios.
source§fn reset<R, P>(&self, pattern: P) -> impl Future<Output = RedisResult<R>>
fn reset<R, P>(&self, pattern: P) -> impl Future<Output = RedisResult<R>>
This command will reset all the masters with matching name.
source§fn config_get<R, K>(&self, name: K) -> impl Future<Output = RedisResult<R>>
fn config_get<R, K>(&self, name: K) -> impl Future<Output = RedisResult<R>>
Get the current value of a global Sentinel configuration parameter. The specified name may be a wildcard,
similar to the Redis CONFIG GET command.
source§fn config_set<R, K, V>(
&self,
name: K,
value: V,
) -> impl Future<Output = RedisResult<R>>
fn config_set<R, K, V>( &self, name: K, value: V, ) -> impl Future<Output = RedisResult<R>>
Set the value of a global Sentinel configuration parameter.
Auto Trait Implementations§
impl Freeze for SentinelClient
impl !RefUnwindSafe for SentinelClient
impl !Send for SentinelClient
impl !Sync for SentinelClient
impl Unpin for SentinelClient
impl !UnwindSafe for SentinelClient
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
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)
🔬This is a nightly-only experimental API. (
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>
Converts
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>
Converts
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