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 { ... }
}
Available on crate feature i-client only.
Expand description

Functions that implement the client interface.

Provided Methods§

source

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.

https://redis.io/commands/client-id

source

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.

source

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.

https://redis.io/commands/client-info

source

fn client_kill<R>( &self, filters: Vec<ClientKillFilter>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Close a given connection or set of connections.

https://redis.io/commands/client-kill

source

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.

https://redis.io/commands/client-list

source

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.

https://redis.io/commands/client-getname

source

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.

https://redis.io/commands/client-setname

source

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).

https://redis.io/commands/client-pause

source

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.

https://redis.io/commands/client-unpause

source

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:

https://redis.io/commands/client-reply

source

fn client_unblock<R, S>( &self, id: S, flag: Option<ClientUnblockFlag>, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<RedisValue>,

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.

https://redis.io/commands/client-unblock

source

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>>

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.

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.

source

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.

https://redis.io/commands/client-trackinginfo/

source

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.

https://redis.io/commands/client-getredir/

source

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.

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.

Object Safety§

This trait is not object safe.

Implementors§