Trait fred::interfaces::ClientInterface
source · pub trait ClientInterface: ClientLike + Sized {
Show 16 methods
// Provided methods
fn client_id<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis { ... }
fn connection_ids(&self) -> impl Future<Output = HashMap<Server, i64>> { ... }
fn client_info<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis { ... }
fn client_kill<R>(
&self,
filters: Vec<ClientKillFilter>,
) -> 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 { ... }
fn client_getname<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis { ... }
fn client_setname<S>(
&self,
name: S,
) -> impl Future<Output = RedisResult<()>>
where S: Into<Str> { ... }
fn client_pause(
&self,
timeout: i64,
mode: Option<ClientPauseKind>,
) -> impl Future<Output = RedisResult<()>> { ... }
fn client_unpause(&self) -> impl Future<Output = RedisResult<()>> { ... }
fn client_reply(
&self,
flag: ClientReplyFlag,
) -> impl Future<Output = RedisResult<()>> { ... }
fn client_unblock<R, S>(
&self,
id: S,
flag: Option<ClientUnblockFlag>,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
S: Into<RedisValue> { ... }
fn unblock_self(
&self,
flag: Option<ClientUnblockFlag>,
) -> impl Future<Output = RedisResult<()>> { ... }
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>>
where R: FromRedis,
T: TryInto<Toggle>,
T::Error: Into<RedisError>,
P: Into<MultipleStrings> { ... }
fn client_trackinginfo<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis { ... }
fn client_getredir<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis { ... }
fn client_caching<R>(
&self,
enabled: bool,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis { ... }
}i-client only.Expand description
Functions that implement the client interface.
Provided Methods§
sourcefn 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.
Note: Against a clustered deployment this will return the ID of a random connection. See connection_ids for more information.
sourcefn 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.
The returned map contains each server’s host:port and the result of calling CLIENT ID on the connection.
Note: despite being async this function will return cached information from the client if possible.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
Note: The client automatically generates a unique name for each client that is shared by all underlying connections. Use `self.id() to read the automatically generated name.
sourcefn 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).
sourcefn 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.
sourcefn 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:
sourcefn 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.
Note: this command is sent on a backchannel connection and will work even when the main connection is blocked.
sourcefn 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.
sourcefn 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.
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>>
i-tracking only.This command enables the tracking feature of the Redis server that is used for server assisted client side caching.
https://redis.io/commands/client-tracking/
This function is designed to work against a specific server, either via a centralized server config or with_options. See crate::interfaces::TrackingInterface::start_tracking for a version that works with all server deployment modes.
sourcefn client_trackinginfo<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
Available on crate feature i-tracking only.
fn client_trackinginfo<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
i-tracking only.The command returns information about the current client connection’s use of the server assisted client side caching feature.
sourcefn client_getredir<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
Available on crate feature i-tracking only.
fn client_getredir<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
i-tracking only.This command returns the client ID we are redirecting our tracking notifications to.
sourcefn client_caching<R>(
&self,
enabled: bool,
) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
Available on crate feature i-tracking only.
fn client_caching<R>(
&self,
enabled: bool,
) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
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.
https://redis.io/commands/client-caching/
This function is designed to work against a specific server. See with_options for a variation that works with all deployment types.