Trait ServerCommands

Source
pub trait ServerCommands<'a> {
Show 53 methods // Provided methods fn acl_cat<C, CC>( self, options: AclCatOptions, ) -> PreparedCommand<'a, Self, CC> where Self: Sized, C: PrimitiveResponse + DeserializeOwned, CC: CollectionResponse<C> { ... } fn acl_deluser<U, UU>( self, usernames: UU, ) -> PreparedCommand<'a, Self, usize> where Self: Sized, U: SingleArg, UU: SingleArgCollection<U> { ... } fn acl_dryrun<U, C, R>( self, username: U, command: C, options: AclDryRunOptions, ) -> PreparedCommand<'a, Self, R> where Self: Sized, U: SingleArg, C: SingleArg, R: PrimitiveResponse { ... } fn acl_genpass<R: PrimitiveResponse>( self, options: AclGenPassOptions, ) -> PreparedCommand<'a, Self, R> where Self: Sized { ... } fn acl_getuser<U, RR>(self, username: U) -> PreparedCommand<'a, Self, RR> where Self: Sized, U: SingleArg, RR: KeyValueCollectionResponse<String, Value> { ... } fn acl_list(self) -> PreparedCommand<'a, Self, Vec<String>> where Self: Sized { ... } fn acl_load(self) -> PreparedCommand<'a, Self, ()> where Self: Sized { ... } fn acl_log<EE>( self, options: AclLogOptions, ) -> PreparedCommand<'a, Self, Vec<EE>> where Self: Sized, EE: KeyValueCollectionResponse<String, Value> + DeserializeOwned { ... } fn acl_save(self) -> PreparedCommand<'a, Self, ()> where Self: Sized { ... } fn acl_setuser<U, R, RR>( self, username: U, rules: RR, ) -> PreparedCommand<'a, Self, ()> where Self: Sized, U: SingleArg, R: SingleArg, RR: SingleArgCollection<R> { ... } fn acl_users<U, UU>(self) -> PreparedCommand<'a, Self, UU> where Self: Sized, U: PrimitiveResponse + DeserializeOwned, UU: CollectionResponse<U> { ... } fn acl_whoami<U: PrimitiveResponse>(self) -> PreparedCommand<'a, Self, U> where Self: Sized { ... } fn command(self) -> PreparedCommand<'a, Self, Vec<CommandInfo>> where Self: Sized { ... } fn command_count(self) -> PreparedCommand<'a, Self, usize> where Self: Sized { ... } fn command_docs<N, NN, DD>( self, command_names: NN, ) -> PreparedCommand<'a, Self, DD> where Self: Sized, N: SingleArg, NN: SingleArgCollection<N>, DD: KeyValueCollectionResponse<String, CommandDoc> { ... } fn command_getkeys<A, AA, KK>( self, args: AA, ) -> PreparedCommand<'a, Self, KK> where Self: Sized, A: SingleArg, AA: SingleArgCollection<A>, KK: CollectionResponse<String> { ... } fn command_getkeysandflags<A, AA, KK>( self, args: AA, ) -> PreparedCommand<'a, Self, KK> where Self: Sized, A: SingleArg, AA: SingleArgCollection<A>, KK: KeyValueCollectionResponse<String, Vec<String>> { ... } fn command_info<N, NN>( self, command_names: NN, ) -> PreparedCommand<'a, Self, Vec<CommandInfo>> where Self: Sized, N: SingleArg, NN: SingleArgCollection<N> { ... } fn command_list<CC>( self, options: CommandListOptions, ) -> PreparedCommand<'a, Self, CC> where Self: Sized, CC: CollectionResponse<String> { ... } fn config_get<P, PP, V, VV>( self, params: PP, ) -> PreparedCommand<'a, Self, VV> where Self: Sized, P: SingleArg, PP: SingleArgCollection<P>, V: PrimitiveResponse, VV: KeyValueCollectionResponse<String, V> { ... } fn config_resetstat(self) -> PreparedCommand<'a, Self, ()> where Self: Sized { ... } fn config_rewrite(self) -> PreparedCommand<'a, Self, ()> where Self: Sized { ... } fn config_set<P, V, C>(self, configs: C) -> PreparedCommand<'a, Self, ()> where Self: Sized, P: SingleArg, V: SingleArg, C: KeyValueArgsCollection<P, V> { ... } fn dbsize(self) -> PreparedCommand<'a, Self, usize> where Self: Sized { ... } fn failover(self, options: FailOverOptions) -> PreparedCommand<'a, Self, ()> where Self: Sized { ... } fn flushdb( self, flushing_mode: FlushingMode, ) -> PreparedCommand<'a, Self, ()> where Self: Sized { ... } fn flushall( self, flushing_mode: FlushingMode, ) -> PreparedCommand<'a, Self, ()> where Self: Sized { ... } fn info<SS>(self, sections: SS) -> PreparedCommand<'a, Self, String> where Self: Sized, SS: SingleArgCollection<InfoSection> { ... } fn lastsave(self) -> PreparedCommand<'a, Self, u64> where Self: Sized { ... } fn latency_doctor(self) -> PreparedCommand<'a, Self, String> where Self: Sized { ... } fn latency_graph( self, event: LatencyHistoryEvent, ) -> PreparedCommand<'a, Self, String> where Self: Sized { ... } fn latency_histogram<C, CC, RR>( self, commands: CC, ) -> PreparedCommand<'a, Self, RR> where Self: Sized, C: SingleArg, CC: SingleArgCollection<C>, RR: KeyValueCollectionResponse<String, CommandHistogram> { ... } fn latency_history<RR>( self, event: LatencyHistoryEvent, ) -> PreparedCommand<'a, Self, RR> where Self: Sized, RR: CollectionResponse<(u32, u32)> { ... } fn latency_latest<RR>(self) -> PreparedCommand<'a, Self, RR> where Self: Sized, RR: CollectionResponse<(String, u32, u32, u32)> { ... } fn latency_reset<EE>(self, events: EE) -> PreparedCommand<'a, Self, usize> where Self: Sized, EE: SingleArgCollection<LatencyHistoryEvent> { ... } fn lolwut(self, options: LolWutOptions) -> PreparedCommand<'a, Self, String> where Self: Sized { ... } fn memory_doctor(self) -> PreparedCommand<'a, Self, String> where Self: Sized { ... } fn memory_malloc_stats(self) -> PreparedCommand<'a, Self, String> where Self: Sized { ... } fn memory_purge(self) -> PreparedCommand<'a, Self, ()> where Self: Sized { ... } fn memory_stats(self) -> PreparedCommand<'a, Self, MemoryStats> where Self: Sized { ... } fn memory_usage<K>( self, key: K, options: MemoryUsageOptions, ) -> PreparedCommand<'a, Self, Option<usize>> where Self: Sized, K: SingleArg { ... } fn module_list<MM>(self) -> PreparedCommand<'a, Self, MM> where Self: Sized, MM: CollectionResponse<ModuleInfo> { ... } fn module_load<P>( self, path: P, options: ModuleLoadOptions, ) -> PreparedCommand<'a, Self, ()> where Self: Sized, P: SingleArg { ... } fn module_unload<N>(self, name: N) -> PreparedCommand<'a, Self, ()> where Self: Sized, N: SingleArg { ... } fn replicaof( self, options: ReplicaOfOptions, ) -> PreparedCommand<'a, Self, ()> where Self: Sized { ... } fn role(self) -> PreparedCommand<'a, Self, RoleResult> where Self: Sized { ... } fn save(self) -> PreparedCommand<'a, Self, ()> where Self: Sized { ... } fn shutdown(self, options: ShutdownOptions) -> PreparedCommand<'a, Self, ()> where Self: Sized { ... } fn slowlog_get( self, options: SlowLogOptions, ) -> PreparedCommand<'a, Self, Vec<SlowLogEntry>> where Self: Sized { ... } fn slowlog_len(self) -> PreparedCommand<'a, Self, usize> where Self: Sized { ... } fn slowlog_reset(self) -> PreparedCommand<'a, Self, ()> where Self: Sized { ... } fn swapdb( self, index1: usize, index2: usize, ) -> PreparedCommand<'a, Self, ()> where Self: Sized { ... } fn time(self) -> PreparedCommand<'a, Self, (u32, u32)> where Self: Sized { ... }
}
Expand description

A group of Redis commands related to Server Management

§See Also

Redis Server Management Commands ACL guide

Provided Methods§

Source

fn acl_cat<C, CC>(self, options: AclCatOptions) -> PreparedCommand<'a, Self, CC>

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

https://redis.io/commands/acl-cat/

Source

fn acl_deluser<U, UU>(self, usernames: UU) -> PreparedCommand<'a, Self, usize>
where Self: Sized, U: SingleArg, UU: SingleArgCollection<U>,

Delete all the specified ACL users and terminate all the connections that are authenticated with such users.

§Return

The number of users that were deleted. This number will not always match the number of arguments since certain users may not exist.

§See Also

https://redis.io/commands/acl-deluser/

Source

fn acl_dryrun<U, C, R>( self, username: U, command: C, options: AclDryRunOptions, ) -> PreparedCommand<'a, Self, R>
where Self: Sized, U: SingleArg, C: SingleArg, R: PrimitiveResponse,

Simulate the execution of a given command by a given user.

§Return

OK on success. An error describing why the user can’t execute the command.

§See Also

https://redis.io/commands/acl-dryrun/

Source

fn acl_genpass<R: PrimitiveResponse>( self, options: AclGenPassOptions, ) -> PreparedCommand<'a, Self, R>
where Self: Sized,

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

https://redis.io/commands/acl-genpass/

Source

fn acl_getuser<U, RR>(self, username: U) -> PreparedCommand<'a, Self, RR>

The command returns all the rules defined for an existing ACL user.

§Return

A collection of ACL rule definitions for the user.

§See Also

https://redis.io/commands/acl-getuser/

Source

fn acl_list(self) -> PreparedCommand<'a, Self, Vec<String>>
where Self: Sized,

The command shows the currently active ACL rules in the Redis server.

§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

§See Also

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

Source

fn acl_load(self) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

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

https://redis.io/commands/acl-load/

Source

fn acl_log<EE>( self, options: AclLogOptions, ) -> PreparedCommand<'a, Self, Vec<EE>>

The command shows a list of recent ACL security events

§Return

A key/value collection of ACL security events. Empty collection when called with the reset option

§See Also

https://redis.io/commands/acl-log/

Source

fn acl_save(self) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

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

https://redis.io/commands/acl-save/

Source

fn acl_setuser<U, R, RR>( self, username: U, rules: RR, ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, U: SingleArg, R: SingleArg, RR: SingleArgCollection<R>,

Create an ACL user with the specified rules or modify the rules of an existing user.

§Errors

If the rules contain errors, the error is returned.

§See Also

https://redis.io/commands/acl-setuser/

Source

fn acl_users<U, UU>(self) -> PreparedCommand<'a, Self, UU>

The command shows a list of all the usernames of the currently configured users in the Redis ACL system.

§Return

A collection of usernames

§See Also

https://redis.io/commands/acl-users/

Source

fn acl_whoami<U: PrimitiveResponse>(self) -> PreparedCommand<'a, Self, U>
where Self: Sized,

Return the username the current connection is authenticated with.

§Return

The username of the current connection.

§See Also

https://redis.io/commands/acl-whoami/

Source

fn command(self) -> PreparedCommand<'a, Self, Vec<CommandInfo>>
where Self: Sized,

Return an array with details about every Redis command.

§Return

A nested list of command details. The order of commands in the array is random.

§See Also

https://redis.io/commands/command/

Source

fn command_count(self) -> PreparedCommand<'a, Self, usize>
where Self: Sized,

Number of total commands in this Redis server.

§Return

number of commands returned by command

§See Also

https://redis.io/commands/command-count/

Source

fn command_docs<N, NN, DD>( self, command_names: NN, ) -> PreparedCommand<'a, Self, DD>

Number of total commands in this Redis server.

§Return

map key=command name, value=command doc

§See Also

https://redis.io/commands/command-docs/

Source

fn command_getkeys<A, AA, KK>(self, args: AA) -> PreparedCommand<'a, Self, KK>

A helper command to let you find the keys from a full Redis command.

§Return

list of keys from your command.

§See Also

https://redis.io/commands/command-_getkeys/

Source

fn command_getkeysandflags<A, AA, KK>( self, args: AA, ) -> PreparedCommand<'a, Self, KK>

A helper command to let you find the keys from a full Redis command together with flags indicating what each key is used for.

§Return

map of keys with their flags from your command.

§See Also

https://redis.io/commands/command-getkeysandflags/

Source

fn command_info<N, NN>( self, command_names: NN, ) -> PreparedCommand<'a, Self, Vec<CommandInfo>>
where Self: Sized, N: SingleArg, NN: SingleArgCollection<N>,

Return an array with details about multiple Redis command.

§Return

A nested list of command details.

§See Also

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

Source

fn command_list<CC>( self, options: CommandListOptions, ) -> PreparedCommand<'a, Self, CC>
where Self: Sized, CC: CollectionResponse<String>,

Return an array of the server’s command names based on optional filters

§Return

an array of the server’s command names.

§See Also

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

Source

fn config_get<P, PP, V, VV>(self, params: PP) -> PreparedCommand<'a, Self, VV>

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

https://redis.io/commands/config-get/

Source

fn config_resetstat(self) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Resets the statistics reported by Redis using the info command.

§See Also

https://redis.io/commands/config-resetstat/

Source

fn config_rewrite(self) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

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

https://redis.io/commands/config-rewrite/

Source

fn config_set<P, V, C>(self, configs: C) -> PreparedCommand<'a, Self, ()>
where Self: Sized, P: SingleArg, V: SingleArg, C: KeyValueArgsCollection<P, V>,

Used in order to reconfigure the server at run time without the need to restart Redis.

§See Also

https://redis.io/commands/config-set/

Source

fn dbsize(self) -> PreparedCommand<'a, Self, usize>
where Self: Sized,

Return the number of keys in the currently-selected database.

§See Also

https://redis.io/commands/dbsize/

Source

fn failover(self, options: FailOverOptions) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

This command will start a coordinated failover between the currently-connected-to master and one of its replicas.

§See Also

https://redis.io/commands/failover/

Source

fn flushdb(self, flushing_mode: FlushingMode) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Delete all the keys of the currently selected DB.

§See Also

https://redis.io/commands/flushdb/

Source

fn flushall(self, flushing_mode: FlushingMode) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Delete all the keys of all the existing databases, not just the currently selected one.

§See Also

https://redis.io/commands/flushall/

Source

fn info<SS>(self, sections: SS) -> PreparedCommand<'a, Self, String>

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

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

Source

fn lastsave(self) -> PreparedCommand<'a, Self, u64>
where Self: Sized,

Return the UNIX TIME of the last DB save executed with success.

§See Also

https://redis.io/commands/lastsave/

Source

fn latency_doctor(self) -> PreparedCommand<'a, Self, String>
where Self: Sized,

This command reports about different latency-related issues and advises about possible remedies.

§Return

String report

§See Also

https://redis.io/commands/latency-doctor/

Source

fn latency_graph( self, event: LatencyHistoryEvent, ) -> PreparedCommand<'a, Self, String>
where Self: Sized,

Produces an ASCII-art style graph for the specified event.

§Return

String graph

§See Also

https://redis.io/commands/latency-graph/

Source

fn latency_histogram<C, CC, RR>( self, commands: CC, ) -> PreparedCommand<'a, Self, RR>

This command reports a cumulative distribution of latencies in the format of a histogram for each of the specified command names.

§Return

The command returns a map where each key is a command name, and each value is a CommandHistogram instance.

§See Also

https://redis.io/commands/latency-histogram/

Source

fn latency_history<RR>( self, event: LatencyHistoryEvent, ) -> PreparedCommand<'a, Self, RR>
where Self: Sized, RR: CollectionResponse<(u32, u32)>,

This command returns the raw data of the event’s latency spikes time series.

§Return

The command returns a collection where each element is a two elements tuple representing

  • the unix timestamp in seconds
  • the latency of the event in milliseconds
§See Also

https://redis.io/commands/latency-history/

Source

fn latency_latest<RR>(self) -> PreparedCommand<'a, Self, RR>
where Self: Sized, RR: CollectionResponse<(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

https://redis.io/commands/latency-latest/

Source

fn latency_reset<EE>(self, events: EE) -> PreparedCommand<'a, Self, usize>

This command resets the latency spikes time series of all, or only some, events.

§Return

the number of event time series that were reset.

§See Also

https://redis.io/commands/latency-latest/

Source

fn lolwut(self, options: LolWutOptions) -> PreparedCommand<'a, Self, String>
where Self: Sized,

The LOLWUT command displays the Redis version: however as a side effect of doing so, it also creates a piece of generative computer art that is different with each version of Redis.

§Return

the string containing the generative computer art, and a text with the Redis version.

§See Also

https://redis.io/commands/lolwut/

Source

fn memory_doctor(self) -> PreparedCommand<'a, Self, String>
where Self: Sized,

This command reports about different memory-related issues that the Redis server experiences, and advises about possible remedies.

§Return

the string report.

§See Also

https://redis.io/commands/memory-doctor/

Source

fn memory_malloc_stats(self) -> PreparedCommand<'a, Self, String>
where Self: Sized,

This command provides an internal statistics report from the memory allocator.

§Return

the memory allocator’s internal statistics report.

§See Also

https://redis.io/commands/memory-malloc-stats/

Source

fn memory_purge(self) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

This command attempts to purge dirty pages so these can be reclaimed by the allocator.

§See Also

https://redis.io/commands/memory-purge/

Source

fn memory_stats(self) -> PreparedCommand<'a, Self, MemoryStats>
where Self: Sized,

This command returns information about the memory usage of the server.

§Return

the memory allocator’s internal statistics report.

§See Also

https://redis.io/commands/memory-stats/

Source

fn memory_usage<K>( self, key: K, options: MemoryUsageOptions, ) -> PreparedCommand<'a, Self, Option<usize>>
where Self: Sized, K: SingleArg,

This command reports the number of bytes that a key and its value require to be stored in RAM.

§Return

the memory usage in bytes, or None when the key does not exist.

§See Also

https://redis.io/commands/memory-usage/

Source

fn module_list<MM>(self) -> PreparedCommand<'a, Self, MM>

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

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

Source

fn module_load<P>( self, path: P, options: ModuleLoadOptions, ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, P: SingleArg,

Loads a module from a dynamic library at runtime.

§See Also

https://redis.io/commands/module-load/

Source

fn module_unload<N>(self, name: N) -> PreparedCommand<'a, Self, ()>
where Self: Sized, N: SingleArg,

Unloads a module.

§See Also

https://redis.io/commands/module-unload/

Source

fn replicaof(self, options: ReplicaOfOptions) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

This command can change the replication settings of a replica on the fly.

§See Also

https://redis.io/commands/replicaof/

Source

fn role(self) -> PreparedCommand<'a, Self, RoleResult>
where Self: Sized,

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

https://redis.io/commands/role/

Source

fn save(self) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

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

https://redis.io/commands/save/

Source

fn shutdown(self, options: ShutdownOptions) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

Shutdown the server

§See Also

https://redis.io/commands/shutdown/

Source

fn slowlog_get( self, options: SlowLogOptions, ) -> PreparedCommand<'a, Self, Vec<SlowLogEntry>>
where Self: Sized,

This command returns entries from the slow log in chronological order.

§See Also

https://redis.io/commands/slowlog-get/

Source

fn slowlog_len(self) -> PreparedCommand<'a, Self, usize>
where Self: Sized,

This command returns the current number of entries in the slow log.

§See Also

https://redis.io/commands/slowlog-len/

Source

fn slowlog_reset(self) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

This command resets the slow log, clearing all entries in it.

§See Also

https://redis.io/commands/slowlog-reset/

Source

fn swapdb(self, index1: usize, index2: usize) -> PreparedCommand<'a, Self, ()>
where Self: Sized,

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.

§See Also

https://redis.io/commands/swapdb/

Source

fn time(self) -> PreparedCommand<'a, Self, (u32, u32)>
where Self: Sized,

The TIME command returns the current server time as a two items lists: a Unix timestamp and the amount of microseconds already elapsed in the current second.

§See Also

https://redis.io/commands/time/

Implementors§

Source§

impl<'a> ServerCommands<'a> for &'a Client

Source§

impl<'a> ServerCommands<'a> for &'a mut Transaction

Source§

impl<'a, 'b> ServerCommands<'a> for &'a mut Pipeline<'b>