pub trait ConnectionCommands<'a>: Sized {
Show 25 methods
// Provided methods
fn auth(
self,
username: impl Serialize,
password: impl Serialize,
) -> PreparedCommand<'a, Self, ()> { ... }
fn client_caching(
self,
mode: ClientCachingMode,
) -> PreparedCommand<'a, Self, Option<()>> { ... }
fn client_getname<R: Response>(self) -> PreparedCommand<'a, Self, R> { ... }
fn client_getredir(self) -> PreparedCommand<'a, Self, i64> { ... }
fn client_help<R: Response>(self) -> PreparedCommand<'a, Self, R> { ... }
fn client_id(self) -> PreparedCommand<'a, Self, i64> { ... }
fn client_info(self) -> PreparedCommand<'a, Self, ClientInfo> { ... }
fn client_kill(
self,
options: ClientKillOptions<'_>,
) -> PreparedCommand<'a, Self, usize> { ... }
fn client_list(
self,
options: ClientListOptions,
) -> PreparedCommand<'a, Self, ClientListResult> { ... }
fn client_no_evict(self, no_evict: bool) -> PreparedCommand<'a, Self, ()> { ... }
fn client_no_touch(self, no_touch: bool) -> PreparedCommand<'a, Self, ()> { ... }
fn client_pause(
self,
timeout: u64,
mode: ClientPauseMode,
) -> PreparedCommand<'a, Self, ()> { ... }
fn client_reply(
self,
mode: ClientReplyMode,
) -> PreparedCommand<'a, Self, ()> { ... }
fn client_setname(
self,
connection_name: impl Serialize,
) -> PreparedCommand<'a, Self, ()> { ... }
fn client_setinfo(
self,
attr: ClientInfoAttribute,
info: impl Serialize,
) -> PreparedCommand<'a, Self, ()> { ... }
fn client_tracking(
self,
status: ClientTrackingStatus,
options: ClientTrackingOptions,
) -> PreparedCommand<'a, Self, ()> { ... }
fn client_trackinginfo(
self,
) -> PreparedCommand<'a, Self, ClientTrackingInfo> { ... }
fn client_unblock(
self,
client_id: i64,
mode: ClientUnblockMode,
) -> PreparedCommand<'a, Self, bool> { ... }
fn client_unpause(self) -> PreparedCommand<'a, Self, bool> { ... }
fn echo<R: Response>(
self,
message: impl Serialize,
) -> PreparedCommand<'a, Self, R> { ... }
fn hello(
self,
options: HelloOptions<'_>,
) -> PreparedCommand<'a, Self, HelloResult> { ... }
fn ping<R: Response>(
self,
message: impl Serialize,
) -> PreparedCommand<'a, Self, R> { ... }
fn quit(self) -> PreparedCommand<'a, Self, ()> { ... }
fn reset(self) -> PreparedCommand<'a, Self, ()> { ... }
fn select(self, index: usize) -> PreparedCommand<'a, Self, ()> { ... }
}Expand description
A group of Redis commands related to connection management
§See Also
Provided Methods§
Sourcefn auth(
self,
username: impl Serialize,
password: impl Serialize,
) -> PreparedCommand<'a, Self, ()>
fn auth( self, username: impl Serialize, password: impl Serialize, ) -> PreparedCommand<'a, Self, ()>
Authenticates the current connection.
This method supports both the legacy authentication (password only) and the Redis 6+ ACL authentication (username and password).
username- The username. Pass()to use the default user (legacy behavior).password- The password.
§Errors
a Redis error if the password, or username/password pair, is invalid.
§See Also
Sourcefn client_caching(
self,
mode: ClientCachingMode,
) -> PreparedCommand<'a, Self, Option<()>>
fn client_caching( self, mode: ClientCachingMode, ) -> PreparedCommand<'a, Self, Option<()>>
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.
§See Also
Sourcefn client_getname<R: Response>(self) -> PreparedCommand<'a, Self, R>
fn client_getname<R: Response>(self) -> PreparedCommand<'a, Self, R>
Sourcefn client_getredir(self) -> PreparedCommand<'a, Self, i64>
fn client_getredir(self) -> PreparedCommand<'a, Self, i64>
This command returns the client ID we are redirecting our tracking notifications to.
§Return
the ID of the client we are redirecting the notifications to. The command returns -1 if client tracking is not enabled, or 0 if client tracking is enabled but we are not redirecting the notifications to any client.
§See Also
Sourcefn client_help<R: Response>(self) -> PreparedCommand<'a, Self, R>
fn client_help<R: Response>(self) -> PreparedCommand<'a, Self, R>
Sourcefn client_id(self) -> PreparedCommand<'a, Self, i64>
fn client_id(self) -> PreparedCommand<'a, Self, i64>
Sourcefn client_info(self) -> PreparedCommand<'a, Self, ClientInfo>
fn client_info(self) -> PreparedCommand<'a, Self, ClientInfo>
Sourcefn client_kill(
self,
options: ClientKillOptions<'_>,
) -> PreparedCommand<'a, Self, usize>
fn client_kill( self, options: ClientKillOptions<'_>, ) -> PreparedCommand<'a, Self, usize>
Sourcefn client_list(
self,
options: ClientListOptions,
) -> PreparedCommand<'a, Self, ClientListResult>
fn client_list( self, options: ClientListOptions, ) -> PreparedCommand<'a, Self, ClientListResult>
Sourcefn client_no_evict(self, no_evict: bool) -> PreparedCommand<'a, Self, ()>
fn client_no_evict(self, no_evict: bool) -> PreparedCommand<'a, Self, ()>
sets the client eviction mode for the current connection.
§See Also
Sourcefn client_no_touch(self, no_touch: bool) -> PreparedCommand<'a, Self, ()>
fn client_no_touch(self, no_touch: bool) -> PreparedCommand<'a, Self, ()>
The command controls whether commands sent by the client will alter the LRU/LFU of the keys they access. If ON, the client will not change LFU/LRU stats. If OFF or send TOUCH, client will change LFU/LRU stats just as a normal client.
§Return
The () type
§Example
client.client_no_touch(true).await?;
client.client_no_touch(false).await?;
}§See Also
Sourcefn client_pause(
self,
timeout: u64,
mode: ClientPauseMode,
) -> PreparedCommand<'a, Self, ()>
fn client_pause( self, timeout: u64, mode: ClientPauseMode, ) -> PreparedCommand<'a, Self, ()>
Connections control command able to suspend all the Redis clients for the specified amount of time (in milliseconds).
§See Also
Sourcefn client_reply(self, mode: ClientReplyMode) -> PreparedCommand<'a, Self, ()>
fn client_reply(self, mode: ClientReplyMode) -> PreparedCommand<'a, Self, ()>
Sometimes it can be useful for clients to completely disable replies from the Redis server.
§See Also
Sourcefn client_setname(
self,
connection_name: impl Serialize,
) -> PreparedCommand<'a, Self, ()>
fn client_setname( self, connection_name: impl Serialize, ) -> PreparedCommand<'a, Self, ()>
Sourcefn client_setinfo(
self,
attr: ClientInfoAttribute,
info: impl Serialize,
) -> PreparedCommand<'a, Self, ()>
fn client_setinfo( self, attr: ClientInfoAttribute, info: impl Serialize, ) -> PreparedCommand<'a, Self, ()>
Assigns various info attributes to the current connection.
There is no limit to the length of these attributes.
However it is not possible to use spaces, newlines, or other non-printable characters.
Look changes with commands client_list or client_info.
§Example
client
.client_setinfo(ClientInfoAttribute::LibName, "rustis")
.await?;
client
.client_setinfo(ClientInfoAttribute::LibVer, "0.13.3")
.await?;
let attrs: String = client.send(cmd("CLIENT").arg("INFO"), None).await?.to()?;
assert!(attrs.contains("lib-name=rustis lib-ver=0.13.3"));§See Also
Sourcefn client_tracking(
self,
status: ClientTrackingStatus,
options: ClientTrackingOptions,
) -> PreparedCommand<'a, Self, ()>
fn client_tracking( self, status: ClientTrackingStatus, options: ClientTrackingOptions, ) -> PreparedCommand<'a, Self, ()>
This command enables the tracking feature of the Redis server,
that is used for server assisted client side caching.
§See Also
Sourcefn client_trackinginfo(self) -> PreparedCommand<'a, Self, ClientTrackingInfo>
fn client_trackinginfo(self) -> PreparedCommand<'a, Self, ClientTrackingInfo>
This command enables the tracking feature of the Redis server,
that is used for server assisted client side caching.
§See Also
Sourcefn client_unblock(
self,
client_id: i64,
mode: ClientUnblockMode,
) -> PreparedCommand<'a, Self, bool>
fn client_unblock( self, client_id: i64, mode: ClientUnblockMode, ) -> PreparedCommand<'a, Self, bool>
This command can unblock, from a different connection,
a client blocked in a blocking operation,
such as for instance BRPOP or XREAD or WAIT.
§Return
true- This command can unblock, from a different connection, a client blocked in a blocking operation, such as for instance BRPOP or XREAD or WAIT.false- if the client wasn’t unblocked.
§See Also
Sourcefn client_unpause(self) -> PreparedCommand<'a, Self, bool>
fn client_unpause(self) -> PreparedCommand<'a, Self, bool>
Used to resume command processing for all clients that were
paused by client_pause.
§See Also
Sourcefn echo<R: Response>(
self,
message: impl Serialize,
) -> PreparedCommand<'a, Self, R>
fn echo<R: Response>( self, message: impl Serialize, ) -> PreparedCommand<'a, Self, R>
Sourcefn hello(
self,
options: HelloOptions<'_>,
) -> PreparedCommand<'a, Self, HelloResult>
fn hello( self, options: HelloOptions<'_>, ) -> PreparedCommand<'a, Self, HelloResult>
Switch to a different protocol, optionally authenticating and setting the connection’s name, or provide a contextual client report.
§See Also
Sourcefn ping<R: Response>(
self,
message: impl Serialize,
) -> PreparedCommand<'a, Self, R>
fn ping<R: Response>( self, message: impl Serialize, ) -> PreparedCommand<'a, Self, R>
Returns PONG if no argument is provided, otherwise return a copy of the argument as a bulk.
message- if the argument is provided, the command returns a copy of the argument. pass()to ignore.
§See Also
Sourcefn quit(self) -> PreparedCommand<'a, Self, ()>
fn quit(self) -> PreparedCommand<'a, Self, ()>
Sourcefn reset(self) -> PreparedCommand<'a, Self, ()>
fn reset(self) -> PreparedCommand<'a, Self, ()>
This command performs a full reset of the connection’s server-side context, mimicking the effect of disconnecting and reconnecting again.
§See Also
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.