Trait redis_driver::ConnectionCommands
source · [−]pub trait ConnectionCommands<T>: PrepareCommand<T> {
Show 22 methods
fn auth<U, P>(
&self,
username: Option<U>,
password: P
) -> CommandResult<'_, T, ()>
where
U: Into<BulkString>,
P: Into<BulkString>,
{ ... }
fn client_caching(
&self,
mode: ClientCachingMode
) -> CommandResult<'_, T, Option<()>> { ... }
fn client_getname<CN>(&self) -> CommandResult<'_, T, Option<CN>>
where
CN: FromValue,
{ ... }
fn client_getredir(&self) -> CommandResult<'_, T, i64> { ... }
fn client_id(&self) -> CommandResult<'_, T, i64> { ... }
fn client_info(&self) -> CommandResult<'_, T, ClientInfo> { ... }
fn client_kill(
&self,
options: ClientKillOptions
) -> CommandResult<'_, T, usize> { ... }
fn client_list(
&self,
options: ClientListOptions
) -> CommandResult<'_, T, ClientListResult> { ... }
fn client_no_evict(&self, no_evict: bool) -> CommandResult<'_, T, ()> { ... }
fn client_pause(
&self,
timeout: u64,
mode: ClientPauseMode
) -> CommandResult<'_, T, ()> { ... }
fn client_reply(&self, mode: ClientReplyMode) -> CommandResult<'_, T, ()> { ... }
fn client_setname<CN>(&self, connection_name: CN) -> CommandResult<'_, T, ()>
where
CN: Into<BulkString>,
{ ... }
fn client_tracking(
&self,
status: ClientTrackingStatus,
options: ClientTrackingOptions
) -> CommandResult<'_, T, ()> { ... }
fn client_trackinginfo(&self) -> CommandResult<'_, T, ClientTrackingInfo> { ... }
fn client_unblock(
&self,
client_id: i64,
mode: ClientUnblockMode
) -> CommandResult<'_, T, bool> { ... }
fn client_unpause(&self) -> CommandResult<'_, T, bool> { ... }
fn echo<M, R>(&self, message: M) -> CommandResult<'_, T, R>
where
M: Into<BulkString>,
R: FromValue,
{ ... }
fn hello(&self, options: HelloOptions) -> CommandResult<'_, T, HelloResult> { ... }
fn ping<R>(&self, options: PingOptions) -> CommandResult<'_, T, R>
where
R: FromValue,
{ ... }
fn quit(&self) -> CommandResult<'_, T, ()> { ... }
fn reset(&self) -> CommandResult<'_, T, ()> { ... }
fn select(&self, index: usize) -> CommandResult<'_, T, ()> { ... }
}
Expand description
A group of Redis commands related to connection management
See Also
Provided Methods
sourcefn auth<U, P>(&self, username: Option<U>, password: P) -> CommandResult<'_, T, ()>where
U: Into<BulkString>,
P: Into<BulkString>,
fn auth<U, P>(&self, username: Option<U>, password: P) -> CommandResult<'_, T, ()>where
U: Into<BulkString>,
P: Into<BulkString>,
sourcefn client_caching(
&self,
mode: ClientCachingMode
) -> CommandResult<'_, T, Option<()>>
fn client_caching(
&self,
mode: ClientCachingMode
) -> CommandResult<'_, T, 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<CN>(&self) -> CommandResult<'_, T, Option<CN>>where
CN: FromValue,
fn client_getname<CN>(&self) -> CommandResult<'_, T, Option<CN>>where
CN: FromValue,
sourcefn client_getredir(&self) -> CommandResult<'_, T, i64>
fn client_getredir(&self) -> CommandResult<'_, T, 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_id(&self) -> CommandResult<'_, T, i64>
fn client_id(&self) -> CommandResult<'_, T, i64>
sourcefn client_info(&self) -> CommandResult<'_, T, ClientInfo>
fn client_info(&self) -> CommandResult<'_, T, ClientInfo>
sourcefn client_kill(&self, options: ClientKillOptions) -> CommandResult<'_, T, usize>
fn client_kill(&self, options: ClientKillOptions) -> CommandResult<'_, T, usize>
sourcefn client_list(
&self,
options: ClientListOptions
) -> CommandResult<'_, T, ClientListResult>
fn client_list(
&self,
options: ClientListOptions
) -> CommandResult<'_, T, ClientListResult>
sourcefn client_no_evict(&self, no_evict: bool) -> CommandResult<'_, T, ()>
fn client_no_evict(&self, no_evict: bool) -> CommandResult<'_, T, ()>
sets the client eviction
mode for the current connection.
See Also
sourcefn client_pause(
&self,
timeout: u64,
mode: ClientPauseMode
) -> CommandResult<'_, T, ()>
fn client_pause(
&self,
timeout: u64,
mode: ClientPauseMode
) -> CommandResult<'_, T, ()>
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) -> CommandResult<'_, T, ()>
fn client_reply(&self, mode: ClientReplyMode) -> CommandResult<'_, T, ()>
Sometimes it can be useful for clients to completely disable replies from the Redis server.
See Also
sourcefn client_setname<CN>(&self, connection_name: CN) -> CommandResult<'_, T, ()>where
CN: Into<BulkString>,
fn client_setname<CN>(&self, connection_name: CN) -> CommandResult<'_, T, ()>where
CN: Into<BulkString>,
sourcefn client_tracking(
&self,
status: ClientTrackingStatus,
options: ClientTrackingOptions
) -> CommandResult<'_, T, ()>
fn client_tracking(
&self,
status: ClientTrackingStatus,
options: ClientTrackingOptions
) -> CommandResult<'_, T, ()>
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) -> CommandResult<'_, T, ClientTrackingInfo>
fn client_trackinginfo(&self) -> CommandResult<'_, T, 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
) -> CommandResult<'_, T, bool>
fn client_unblock(
&self,
client_id: i64,
mode: ClientUnblockMode
) -> CommandResult<'_, T, 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) -> CommandResult<'_, T, bool>
fn client_unpause(&self) -> CommandResult<'_, T, bool>
Used to resume command processing for all clients that were
paused by client_pause
.
See Also
sourcefn echo<M, R>(&self, message: M) -> CommandResult<'_, T, R>where
M: Into<BulkString>,
R: FromValue,
fn echo<M, R>(&self, message: M) -> CommandResult<'_, T, R>where
M: Into<BulkString>,
R: FromValue,
sourcefn hello(&self, options: HelloOptions) -> CommandResult<'_, T, HelloResult>
fn hello(&self, options: HelloOptions) -> CommandResult<'_, T, 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>(&self, options: PingOptions) -> CommandResult<'_, T, R>where
R: FromValue,
fn ping<R>(&self, options: PingOptions) -> CommandResult<'_, T, R>where
R: FromValue,
Returns PONG if no argument is provided, otherwise return a copy of the argument as a bulk.
See Also
sourcefn quit(&self) -> CommandResult<'_, T, ()>
fn quit(&self) -> CommandResult<'_, T, ()>
sourcefn reset(&self) -> CommandResult<'_, T, ()>
fn reset(&self) -> CommandResult<'_, T, ()>
This command performs a full reset of the connection’s server-side context, mimicking the effect of disconnecting and reconnecting again.