Trait redis_driver::ServerCommands
source · [−]pub trait ServerCommands<T>: PrepareCommand<T> {
Show 54 methods
fn monitor(&self) -> Future<'_, MonitorStream>;
fn acl_cat<C, CC>(&self, options: AclCatOptions) -> CommandResult<'_, T, CC>
where
C: FromValue,
CC: FromSingleValueArray<C>,
{ ... }
fn acl_deluser<U, UU>(&self, usernames: UU) -> CommandResult<'_, T, usize>
where
U: Into<BulkString>,
UU: SingleArgOrCollection<U>,
{ ... }
fn acl_dryrun<U, C, R>(
&self,
username: U,
command: C,
options: AclDryRunOptions
) -> CommandResult<'_, T, R>
where
U: Into<BulkString>,
C: Into<BulkString>,
R: FromValue,
{ ... }
fn acl_genpass<R: FromValue>(
&self,
options: AclGenPassOptions
) -> CommandResult<'_, T, R> { ... }
fn acl_getuser<U, RR>(&self, username: U) -> CommandResult<'_, T, RR>
where
U: Into<BulkString>,
RR: FromKeyValueValueArray<String, Value>,
{ ... }
fn acl_list(&self) -> CommandResult<'_, T, Vec<String>> { ... }
fn acl_load(&self) -> CommandResult<'_, T, ()> { ... }
fn acl_log<EE>(
&self,
options: AclLogOptions
) -> CommandResult<'_, T, Vec<EE>>
where
EE: FromKeyValueValueArray<String, Value>,
{ ... }
fn acl_save(&self) -> CommandResult<'_, T, ()> { ... }
fn acl_setuser<U, R, RR>(
&self,
username: U,
rules: RR
) -> CommandResult<'_, T, ()>
where
U: Into<BulkString>,
R: Into<BulkString>,
RR: SingleArgOrCollection<R>,
{ ... }
fn acl_users<U, UU>(&self) -> CommandResult<'_, T, UU>
where
U: FromValue,
UU: FromSingleValueArray<U>,
{ ... }
fn acl_whoami<U: FromValue>(&self) -> CommandResult<'_, T, U> { ... }
fn command(&self) -> CommandResult<'_, T, Vec<CommandInfo>> { ... }
fn command_count(&self) -> CommandResult<'_, T, usize> { ... }
fn command_docs<N, NN, DD>(
&self,
command_names: NN
) -> CommandResult<'_, T, DD>
where
N: Into<BulkString>,
NN: SingleArgOrCollection<N>,
DD: FromKeyValueValueArray<String, CommandDoc>,
{ ... }
fn command_getkeys<A, AA, KK>(&self, args: AA) -> CommandResult<'_, T, KK>
where
A: Into<BulkString>,
AA: SingleArgOrCollection<A>,
KK: FromSingleValueArray<String>,
{ ... }
fn command_getkeysandflags<A, AA, KK>(
&self,
args: AA
) -> CommandResult<'_, T, KK>
where
A: Into<BulkString>,
AA: SingleArgOrCollection<A>,
KK: FromKeyValueValueArray<String, Vec<String>>,
{ ... }
fn command_info<N, NN>(
&self,
command_names: NN
) -> CommandResult<'_, T, Vec<CommandInfo>>
where
N: Into<BulkString>,
NN: SingleArgOrCollection<N>,
{ ... }
fn command_list<CC>(
&self,
options: CommandListOptions
) -> CommandResult<'_, T, CC>
where
CC: FromSingleValueArray<String>,
{ ... }
fn config_get<P, PP, V, VV>(&self, params: PP) -> CommandResult<'_, T, VV>
where
P: Into<BulkString>,
PP: SingleArgOrCollection<P>,
V: FromValue,
VV: FromKeyValueValueArray<String, V>,
{ ... }
fn config_resetstat(&self) -> CommandResult<'_, T, ()> { ... }
fn config_rewrite(&self) -> CommandResult<'_, T, ()> { ... }
fn config_set<P, V, C>(&self, configs: C) -> CommandResult<'_, T, ()>
where
P: Into<BulkString>,
V: Into<BulkString>,
C: KeyValueArgOrCollection<P, V>,
{ ... }
fn dbsize(&self) -> CommandResult<'_, T, usize> { ... }
fn failover(&self, options: FailOverOptions) -> CommandResult<'_, T, ()> { ... }
fn flushdb(&self, flushing_mode: FlushingMode) -> CommandResult<'_, T, ()> { ... }
fn flushall(&self, flushing_mode: FlushingMode) -> CommandResult<'_, T, ()> { ... }
fn info<SS>(&self, sections: SS) -> CommandResult<'_, T, String>
where
SS: SingleArgOrCollection<InfoSection>,
{ ... }
fn lastsave(&self) -> CommandResult<'_, T, u64> { ... }
fn latency_doctor(&self) -> CommandResult<'_, T, String> { ... }
fn latency_graph(
&self,
event: LatencyHistoryEvent
) -> CommandResult<'_, T, String> { ... }
fn latency_histogram<C, CC, RR>(
&self,
commands: CC
) -> CommandResult<'_, T, RR>
where
C: Into<BulkString>,
CC: SingleArgOrCollection<C>,
RR: FromKeyValueValueArray<String, CommandHistogram>,
{ ... }
fn latency_history<RR>(
&self,
event: LatencyHistoryEvent
) -> CommandResult<'_, T, RR>
where
RR: FromSingleValueArray<(u32, u32)>,
{ ... }
fn latency_latest<RR>(&self) -> CommandResult<'_, T, RR>
where
RR: FromSingleValueArray<(String, u32, u32, u32)>,
{ ... }
fn latency_reset<EE>(&self, events: EE) -> CommandResult<'_, T, usize>
where
EE: SingleArgOrCollection<LatencyHistoryEvent>,
{ ... }
fn lolwut(&self, options: LolWutOptions) -> CommandResult<'_, T, String> { ... }
fn memory_doctor(&self) -> CommandResult<'_, T, String> { ... }
fn memory_malloc_stats(&self) -> CommandResult<'_, T, String> { ... }
fn memory_purge(&self) -> CommandResult<'_, T, ()> { ... }
fn memory_stats(&self) -> CommandResult<'_, T, MemoryStats> { ... }
fn memory_usage<K>(
&self,
key: K,
options: MemoryUsageOptions
) -> CommandResult<'_, T, Option<usize>>
where
K: Into<BulkString>,
{ ... }
fn module_list<MM>(&self) -> CommandResult<'_, T, MM>
where
MM: FromSingleValueArray<ModuleInfo>,
{ ... }
fn module_load<P>(
&self,
path: P,
options: ModuleLoadOptions
) -> CommandResult<'_, T, ()>
where
P: Into<BulkString>,
{ ... }
fn module_unload<N>(&self, name: N) -> CommandResult<'_, T, ()>
where
N: Into<BulkString>,
{ ... }
fn replicaof(&self, options: ReplicaOfOptions) -> CommandResult<'_, T, ()> { ... }
fn role(&self) -> CommandResult<'_, T, RoleResult> { ... }
fn save(&self) -> CommandResult<'_, T, ()> { ... }
fn shutdown(&self, options: ShutdownOptions) -> CommandResult<'_, T, ()> { ... }
fn slowlog_get(
&self,
options: SlowLogOptions
) -> CommandResult<'_, T, Vec<SlowLogEntry>> { ... }
fn slowlog_len(&self) -> CommandResult<'_, T, usize> { ... }
fn slowlog_reset(&self) -> CommandResult<'_, T, ()> { ... }
fn swapdb(&self, index1: usize, index2: usize) -> CommandResult<'_, T, ()> { ... }
fn time(&self) -> CommandResult<'_, T, (u32, u32)> { ... }
}
Expand description
A group of Redis commands related to Server Management
See Also
Required Methods
sourcefn monitor(&self) -> Future<'_, MonitorStream>
fn monitor(&self) -> Future<'_, MonitorStream>
Debugging command that streams back every command processed by the Redis server.
See Also
Provided Methods
sourcefn acl_cat<C, CC>(&self, options: AclCatOptions) -> CommandResult<'_, T, CC>where
C: FromValue,
CC: FromSingleValueArray<C>,
fn acl_cat<C, CC>(&self, options: AclCatOptions) -> CommandResult<'_, T, CC>where
C: FromValue,
CC: FromSingleValueArray<C>,
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.
Return
A collection of ACL categories or a collection of commands inside a given category.
Errors
The command may return an error if an invalid category name is given as argument.
See Also
sourcefn acl_deluser<U, UU>(&self, usernames: UU) -> CommandResult<'_, T, usize>where
U: Into<BulkString>,
UU: SingleArgOrCollection<U>,
fn acl_deluser<U, UU>(&self, usernames: UU) -> CommandResult<'_, T, usize>where
U: Into<BulkString>,
UU: SingleArgOrCollection<U>,
sourcefn acl_dryrun<U, C, R>(
&self,
username: U,
command: C,
options: AclDryRunOptions
) -> CommandResult<'_, T, R>where
U: Into<BulkString>,
C: Into<BulkString>,
R: FromValue,
fn acl_dryrun<U, C, R>(
&self,
username: U,
command: C,
options: AclDryRunOptions
) -> CommandResult<'_, T, R>where
U: Into<BulkString>,
C: Into<BulkString>,
R: FromValue,
sourcefn acl_genpass<R: FromValue>(
&self,
options: AclGenPassOptions
) -> CommandResult<'_, T, R>
fn acl_genpass<R: FromValue>(
&self,
options: AclGenPassOptions
) -> CommandResult<'_, T, R>
Generates a password starting from /dev/urandom if available, otherwise (in systems without /dev/urandom) it uses a weaker system that is likely still better than picking a weak password by hand.
Return
by default 64 bytes string representing 256 bits of pseudorandom data. Otherwise if an argument if needed, the output string length is the number of specified bits (rounded to the next multiple of 4) divided by 4.
See Also
sourcefn acl_getuser<U, RR>(&self, username: U) -> CommandResult<'_, T, RR>where
U: Into<BulkString>,
RR: FromKeyValueValueArray<String, Value>,
fn acl_getuser<U, RR>(&self, username: U) -> CommandResult<'_, T, RR>where
U: Into<BulkString>,
RR: FromKeyValueValueArray<String, Value>,
sourcefn acl_list(&self) -> CommandResult<'_, T, Vec<String>>
fn acl_list(&self) -> CommandResult<'_, T, Vec<String>>
sourcefn acl_load(&self) -> CommandResult<'_, T, ()>
fn acl_load(&self) -> CommandResult<'_, T, ()>
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.
Return
An array of strings. Each line in the returned array defines a different user, and the format is the same used in the redis.conf file or the external ACL file
Errors
The command may fail with an error for several reasons:
- if the file is not readable,
- if there is an error inside the file, and in such case the error will be reported to the user in the error.
- Finally the command will fail if the server is not configured to use an external ACL file.
See Also
sourcefn acl_log<EE>(&self, options: AclLogOptions) -> CommandResult<'_, T, Vec<EE>>where
EE: FromKeyValueValueArray<String, Value>,
fn acl_log<EE>(&self, options: AclLogOptions) -> CommandResult<'_, T, Vec<EE>>where
EE: FromKeyValueValueArray<String, Value>,
sourcefn acl_save(&self) -> CommandResult<'_, T, ()>
fn acl_save(&self) -> CommandResult<'_, T, ()>
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.
Errors
The command may fail with an error for several reasons:
- if the file cannot be written
- if the server is not configured to use an external ACL file.
See Also
sourcefn acl_setuser<U, R, RR>(
&self,
username: U,
rules: RR
) -> CommandResult<'_, T, ()>where
U: Into<BulkString>,
R: Into<BulkString>,
RR: SingleArgOrCollection<R>,
fn acl_setuser<U, R, RR>(
&self,
username: U,
rules: RR
) -> CommandResult<'_, T, ()>where
U: Into<BulkString>,
R: Into<BulkString>,
RR: SingleArgOrCollection<R>,
sourcefn acl_users<U, UU>(&self) -> CommandResult<'_, T, UU>where
U: FromValue,
UU: FromSingleValueArray<U>,
fn acl_users<U, UU>(&self) -> CommandResult<'_, T, UU>where
U: FromValue,
UU: FromSingleValueArray<U>,
sourcefn acl_whoami<U: FromValue>(&self) -> CommandResult<'_, T, U>
fn acl_whoami<U: FromValue>(&self) -> CommandResult<'_, T, U>
sourcefn command(&self) -> CommandResult<'_, T, Vec<CommandInfo>>
fn command(&self) -> CommandResult<'_, T, Vec<CommandInfo>>
sourcefn command_count(&self) -> CommandResult<'_, T, usize>
fn command_count(&self) -> CommandResult<'_, T, usize>
sourcefn command_docs<N, NN, DD>(&self, command_names: NN) -> CommandResult<'_, T, DD>where
N: Into<BulkString>,
NN: SingleArgOrCollection<N>,
DD: FromKeyValueValueArray<String, CommandDoc>,
fn command_docs<N, NN, DD>(&self, command_names: NN) -> CommandResult<'_, T, DD>where
N: Into<BulkString>,
NN: SingleArgOrCollection<N>,
DD: FromKeyValueValueArray<String, CommandDoc>,
sourcefn command_getkeys<A, AA, KK>(&self, args: AA) -> CommandResult<'_, T, KK>where
A: Into<BulkString>,
AA: SingleArgOrCollection<A>,
KK: FromSingleValueArray<String>,
fn command_getkeys<A, AA, KK>(&self, args: AA) -> CommandResult<'_, T, KK>where
A: Into<BulkString>,
AA: SingleArgOrCollection<A>,
KK: FromSingleValueArray<String>,
sourcefn command_getkeysandflags<A, AA, KK>(
&self,
args: AA
) -> CommandResult<'_, T, KK>where
A: Into<BulkString>,
AA: SingleArgOrCollection<A>,
KK: FromKeyValueValueArray<String, Vec<String>>,
fn command_getkeysandflags<A, AA, KK>(
&self,
args: AA
) -> CommandResult<'_, T, KK>where
A: Into<BulkString>,
AA: SingleArgOrCollection<A>,
KK: FromKeyValueValueArray<String, Vec<String>>,
sourcefn command_info<N, NN>(
&self,
command_names: NN
) -> CommandResult<'_, T, Vec<CommandInfo>>where
N: Into<BulkString>,
NN: SingleArgOrCollection<N>,
fn command_info<N, NN>(
&self,
command_names: NN
) -> CommandResult<'_, T, Vec<CommandInfo>>where
N: Into<BulkString>,
NN: SingleArgOrCollection<N>,
sourcefn command_list<CC>(
&self,
options: CommandListOptions
) -> CommandResult<'_, T, CC>where
CC: FromSingleValueArray<String>,
fn command_list<CC>(
&self,
options: CommandListOptions
) -> CommandResult<'_, T, CC>where
CC: FromSingleValueArray<String>,
sourcefn config_get<P, PP, V, VV>(&self, params: PP) -> CommandResult<'_, T, VV>where
P: Into<BulkString>,
PP: SingleArgOrCollection<P>,
V: FromValue,
VV: FromKeyValueValueArray<String, V>,
fn config_get<P, PP, V, VV>(&self, params: PP) -> CommandResult<'_, T, VV>where
P: Into<BulkString>,
PP: SingleArgOrCollection<P>,
V: FromValue,
VV: FromKeyValueValueArray<String, V>,
Used to read the configuration parameters of a running Redis server.
For every key that does not hold a string value or does not exist, the special value nil is returned. Because of this, the operation never fails.
Return
Array reply: collection of the requested params with their matching values.
See Also
sourcefn config_resetstat(&self) -> CommandResult<'_, T, ()>
fn config_resetstat(&self) -> CommandResult<'_, T, ()>
sourcefn config_rewrite(&self) -> CommandResult<'_, T, ()>
fn config_rewrite(&self) -> CommandResult<'_, T, ()>
Rewrites the redis.conf file the server was started with,
applying the minimal changes needed to make it reflect the configuration currently used by the server,
which may be different compared to the original one because of the use of the
config_set
command.
See Also
sourcefn config_set<P, V, C>(&self, configs: C) -> CommandResult<'_, T, ()>where
P: Into<BulkString>,
V: Into<BulkString>,
C: KeyValueArgOrCollection<P, V>,
fn config_set<P, V, C>(&self, configs: C) -> CommandResult<'_, T, ()>where
P: Into<BulkString>,
V: Into<BulkString>,
C: KeyValueArgOrCollection<P, V>,
Used in order to reconfigure the server at run time without the need to restart Redis.
See Also
sourcefn dbsize(&self) -> CommandResult<'_, T, usize>
fn dbsize(&self) -> CommandResult<'_, T, usize>
Return the number of keys in the currently-selected database.
See Also
sourcefn failover(&self, options: FailOverOptions) -> CommandResult<'_, T, ()>
fn failover(&self, options: FailOverOptions) -> CommandResult<'_, T, ()>
This command will start a coordinated failover between the currently-connected-to master and one of its replicas.
See Also
sourcefn flushdb(&self, flushing_mode: FlushingMode) -> CommandResult<'_, T, ()>
fn flushdb(&self, flushing_mode: FlushingMode) -> CommandResult<'_, T, ()>
sourcefn flushall(&self, flushing_mode: FlushingMode) -> CommandResult<'_, T, ()>
fn flushall(&self, flushing_mode: FlushingMode) -> CommandResult<'_, T, ()>
Delete all the keys of all the existing databases, not just the currently selected one.
See Also
sourcefn info<SS>(&self, sections: SS) -> CommandResult<'_, T, String>where
SS: SingleArgOrCollection<InfoSection>,
fn info<SS>(&self, sections: SS) -> CommandResult<'_, T, String>where
SS: SingleArgOrCollection<InfoSection>,
This command returns information and statistics about the server in a format that is simple to parse by computers and easy to read by humans.
See Also
sourcefn lastsave(&self) -> CommandResult<'_, T, u64>
fn lastsave(&self) -> CommandResult<'_, T, u64>
Return the UNIX TIME of the last DB save executed with success.
See Also
sourcefn latency_doctor(&self) -> CommandResult<'_, T, String>
fn latency_doctor(&self) -> CommandResult<'_, T, String>
sourcefn latency_graph(
&self,
event: LatencyHistoryEvent
) -> CommandResult<'_, T, String>
fn latency_graph(
&self,
event: LatencyHistoryEvent
) -> CommandResult<'_, T, String>
sourcefn latency_histogram<C, CC, RR>(&self, commands: CC) -> CommandResult<'_, T, RR>where
C: Into<BulkString>,
CC: SingleArgOrCollection<C>,
RR: FromKeyValueValueArray<String, CommandHistogram>,
fn latency_histogram<C, CC, RR>(&self, commands: CC) -> CommandResult<'_, T, RR>where
C: Into<BulkString>,
CC: SingleArgOrCollection<C>,
RR: FromKeyValueValueArray<String, CommandHistogram>,
sourcefn latency_history<RR>(
&self,
event: LatencyHistoryEvent
) -> CommandResult<'_, T, RR>where
RR: FromSingleValueArray<(u32, u32)>,
fn latency_history<RR>(
&self,
event: LatencyHistoryEvent
) -> CommandResult<'_, T, RR>where
RR: FromSingleValueArray<(u32, u32)>,
sourcefn latency_latest<RR>(&self) -> CommandResult<'_, T, RR>where
RR: FromSingleValueArray<(String, u32, u32, u32)>,
fn latency_latest<RR>(&self) -> CommandResult<'_, T, RR>where
RR: FromSingleValueArray<(String, u32, u32, u32)>,
This command reports the latest latency events logged.
Return
A collection of the latest latency events logged. Each reported event has the following fields:
- Event name.
- Unix timestamp of the latest latency spike for the event.
- Latest event latency in millisecond.
- All-time maximum latency for this event.
“All-time” means the maximum latency since the Redis instance was started,
or the time that events were reset
.
See Also
sourcefn latency_reset<EE>(&self, events: EE) -> CommandResult<'_, T, usize>where
EE: SingleArgOrCollection<LatencyHistoryEvent>,
fn latency_reset<EE>(&self, events: EE) -> CommandResult<'_, T, usize>where
EE: SingleArgOrCollection<LatencyHistoryEvent>,
sourcefn lolwut(&self, options: LolWutOptions) -> CommandResult<'_, T, String>
fn lolwut(&self, options: LolWutOptions) -> CommandResult<'_, T, String>
sourcefn memory_doctor(&self) -> CommandResult<'_, T, String>
fn memory_doctor(&self) -> CommandResult<'_, T, String>
sourcefn memory_malloc_stats(&self) -> CommandResult<'_, T, String>
fn memory_malloc_stats(&self) -> CommandResult<'_, T, String>
sourcefn memory_purge(&self) -> CommandResult<'_, T, ()>
fn memory_purge(&self) -> CommandResult<'_, T, ()>
This command attempts to purge dirty pages so these can be reclaimed by the allocator.
See Also
sourcefn memory_stats(&self) -> CommandResult<'_, T, MemoryStats>
fn memory_stats(&self) -> CommandResult<'_, T, MemoryStats>
sourcefn memory_usage<K>(
&self,
key: K,
options: MemoryUsageOptions
) -> CommandResult<'_, T, Option<usize>>where
K: Into<BulkString>,
fn memory_usage<K>(
&self,
key: K,
options: MemoryUsageOptions
) -> CommandResult<'_, T, Option<usize>>where
K: Into<BulkString>,
sourcefn module_list<MM>(&self) -> CommandResult<'_, T, MM>where
MM: FromSingleValueArray<ModuleInfo>,
fn module_list<MM>(&self) -> CommandResult<'_, T, MM>where
MM: FromSingleValueArray<ModuleInfo>,
Returns information about the modules loaded to the server.
Return
list of loaded modules.
Each element in the list represents a module as an instance of ModuleInfo
See Also
sourcefn module_load<P>(
&self,
path: P,
options: ModuleLoadOptions
) -> CommandResult<'_, T, ()>where
P: Into<BulkString>,
fn module_load<P>(
&self,
path: P,
options: ModuleLoadOptions
) -> CommandResult<'_, T, ()>where
P: Into<BulkString>,
sourcefn module_unload<N>(&self, name: N) -> CommandResult<'_, T, ()>where
N: Into<BulkString>,
fn module_unload<N>(&self, name: N) -> CommandResult<'_, T, ()>where
N: Into<BulkString>,
sourcefn replicaof(&self, options: ReplicaOfOptions) -> CommandResult<'_, T, ()>
fn replicaof(&self, options: ReplicaOfOptions) -> CommandResult<'_, T, ()>
This command can change the replication settings of a replica on the fly.
See Also
sourcefn role(&self) -> CommandResult<'_, T, RoleResult>
fn role(&self) -> CommandResult<'_, T, RoleResult>
Provide information on the role of a Redis instance in the context of replication,
by returning if the instance is currently a master
, slave
, or sentinel
.
See Also
sourcefn save(&self) -> CommandResult<'_, T, ()>
fn save(&self) -> CommandResult<'_, T, ()>
This command performs a synchronous save of the dataset producing a point in time snapshot of all the data inside the Redis instance, in the form of an RDB file.
See Also
sourcefn shutdown(&self, options: ShutdownOptions) -> CommandResult<'_, T, ()>
fn shutdown(&self, options: ShutdownOptions) -> CommandResult<'_, T, ()>
sourcefn slowlog_get(
&self,
options: SlowLogOptions
) -> CommandResult<'_, T, Vec<SlowLogEntry>>
fn slowlog_get(
&self,
options: SlowLogOptions
) -> CommandResult<'_, T, Vec<SlowLogEntry>>
This command returns entries from the slow log in chronological order.
See Also
sourcefn slowlog_len(&self) -> CommandResult<'_, T, usize>
fn slowlog_len(&self) -> CommandResult<'_, T, usize>
This command returns the current number of entries in the slow log.
See Also
sourcefn slowlog_reset(&self) -> CommandResult<'_, T, ()>
fn slowlog_reset(&self) -> CommandResult<'_, T, ()>
This command resets the slow log, clearing all entries in it.
See Also
sourcefn swapdb(&self, index1: usize, index2: usize) -> CommandResult<'_, T, ()>
fn swapdb(&self, index1: usize, index2: usize) -> CommandResult<'_, T, ()>
This command swaps two Redis databases, so that immediately all the clients connected to a given database will see the data of the other database, and the other way around.