Struct Transaction

Source
pub struct Transaction { /* private fields */ }
Expand description

Represents an on-going transaction on a specific client instance.

Implementations§

Source§

impl Transaction

Source

pub fn queue(&mut self, command: Command)

Queue a command into the transaction.

Source

pub fn forget(&mut self, command: Command)

Queue a command into the transaction and forget its response.

Source

pub async fn execute<T: FromValue>(self) -> Result<T>

Trait Implementations§

Source§

impl BitmapCommands for Transaction

Source§

fn bitcount<K>( &mut self, key: K, range: BitRange, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>,

Count the number of set bits (population counting) in a string. Read more
Source§

fn bitfield<K, C, E, O>( &mut self, key: K, sub_commands: C, ) -> PreparedCommand<'_, Self, Vec<u64>>

The command treats a Redis string as an array of bits, and is capable of addressing specific integer fields of varying bit widths and arbitrary non (necessary) aligned offset. Read more
Source§

fn bitfield_readonly<K, C, E, O>( &mut self, key: K, get_commands: C, ) -> PreparedCommand<'_, Self, Vec<u64>>

Read-only variant of the BITFIELD command. It is like the original BITFIELD but only accepts GET subcommand and can safely be used in read-only replicas. Read more
Source§

fn bitop<D, K, KK>( &mut self, operation: BitOperation, dest_key: D, keys: KK, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, D: Into<CommandArg>, K: Into<CommandArg>, KK: SingleArgOrCollection<K>,

Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key. Read more
Source§

fn bitpos<K>( &mut self, key: K, bit: u64, range: BitRange, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>,

Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key. Read more
Source§

fn getbit<K>(&mut self, key: K, offset: u64) -> PreparedCommand<'_, Self, u64>
where Self: Sized, K: Into<CommandArg>,

Returns the bit value at offset in the string value stored at key. Read more
Source§

fn setbit<K>( &mut self, key: K, offset: u64, value: u64, ) -> PreparedCommand<'_, Self, u64>
where Self: Sized, K: Into<CommandArg>,

Sets or clears the bit at offset in the string value stored at key. Read more
Source§

impl GenericCommands for Transaction

Source§

fn copy<S, D>( &mut self, source: S, destination: D, destination_db: Option<usize>, replace: bool, ) -> PreparedCommand<'_, Self, bool>
where Self: Sized, S: Into<CommandArg>, D: Into<CommandArg>,

This command copies the value stored at the source key to the destination key. Read more
Source§

fn del<K, C>(&mut self, keys: C) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, C: SingleArgOrCollection<K>,

Removes the specified keys. A key is ignored if it does not exist. Read more
Source§

fn dump<K>(&mut self, key: K) -> PreparedCommand<'_, Self, DumpResult>
where Self: Sized, K: Into<CommandArg>,

Serialize the value stored at key in a Redis-specific format and return it to the user. Read more
Source§

fn exists<K, C>(&mut self, keys: C) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, C: SingleArgOrCollection<K>,

Returns if keys exist. Read more
Source§

fn expire<K>( &mut self, key: K, seconds: u64, option: ExpireOption, ) -> PreparedCommand<'_, Self, bool>
where Self: Sized, K: Into<CommandArg>,

Set a timeout on key in seconds Read more
Source§

fn expireat<K>( &mut self, key: K, unix_time_seconds: u64, option: ExpireOption, ) -> PreparedCommand<'_, Self, bool>
where Self: Sized, K: Into<CommandArg>,

EXPIREAT has the same effect and semantic as EXPIRE, but instead of specifying the number of seconds representing the TTL (time to live), it takes an absolute Unix timestamp (seconds since January 1, 1970) Read more
Source§

fn expiretime<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
where Self: Sized, K: Into<CommandArg>,

Returns the absolute Unix timestamp (since January 1, 1970) in seconds at which the given key will expire. Read more
Source§

fn keys<P, K, A>(&mut self, pattern: P) -> PreparedCommand<'_, Self, A>
where Self: Sized, P: Into<CommandArg>, K: FromValue, A: FromSingleValueArray<K>,

Returns all keys matching pattern. Read more
Source§

fn migrate<H, K>( &mut self, host: H, port: u16, key: K, destination_db: usize, timeout: u64, options: MigrateOptions, ) -> PreparedCommand<'_, Self, MigrateResult>
where Self: Sized, H: Into<CommandArg>, K: Into<CommandArg>,

Atomically transfer a key or a collection of keys from a source Redis instance to a destination Redis instance. Read more
Source§

fn move_<K>(&mut self, key: K, db: usize) -> PreparedCommand<'_, Self, i64>
where Self: Sized, K: Into<CommandArg>,

Move key from the currently selected database to the specified destination database. Read more
Source§

fn object_encoding<K, E>(&mut self, key: K) -> PreparedCommand<'_, Self, E>
where Self: Sized, K: Into<CommandArg>, E: FromValue,

Returns the internal encoding for the Redis object stored at key Read more
Source§

fn object_freq<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
where Self: Sized, K: Into<CommandArg>,

This command returns the logarithmic access frequency counter of a Redis object stored at key. Read more
Source§

fn object_idle_time<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
where Self: Sized, K: Into<CommandArg>,

This command returns the time in seconds since the last access to the value stored at key. Read more
Source§

fn object_refcount<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
where Self: Sized, K: Into<CommandArg>,

This command returns the reference count of the stored at key. Read more
Source§

fn persist<K>(&mut self, key: K) -> PreparedCommand<'_, Self, bool>
where Self: Sized, K: Into<CommandArg>,

Remove the existing timeout on key, turning the key from volatile (a key with an expire set) to persistent (a key that will never expire as no timeout is associated). Read more
Source§

fn pexpire<K>( &mut self, key: K, milliseconds: u64, option: ExpireOption, ) -> PreparedCommand<'_, Self, bool>
where Self: Sized, K: Into<CommandArg>,

This command works exactly like EXPIRE but the time to live of the key is specified in milliseconds instead of seconds. Read more
Source§

fn pexpireat<K>( &mut self, key: K, unix_time_milliseconds: u64, option: ExpireOption, ) -> PreparedCommand<'_, Self, bool>
where Self: Sized, K: Into<CommandArg>,

PEXPIREAT has the same effect and semantic as EXPIREAT, but the Unix time at which the key will expire is specified in milliseconds instead of seconds. Read more
Source§

fn pexpiretime<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
where Self: Sized, K: Into<CommandArg>,

PEXPIRETIME has the same semantic as EXPIRETIME, but returns the absolute Unix expiration timestamp in milliseconds instead of seconds. Read more
Source§

fn pttl<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
where Self: Sized, K: Into<CommandArg>,

Returns the remaining time to live of a key that has a timeout. Read more
Source§

fn randomkey<R>(&mut self) -> PreparedCommand<'_, Self, R>
where Self: Sized, R: FromValue,

Return a random key from the currently selected database. Read more
Source§

fn rename<K1, K2>( &mut self, key: K1, new_key: K2, ) -> PreparedCommand<'_, Self, ()>
where Self: Sized, K1: Into<CommandArg>, K2: Into<CommandArg>,

Renames key to newkey. Read more
Source§

fn renamenx<K1, K2>( &mut self, key: K1, new_key: K2, ) -> PreparedCommand<'_, Self, bool>
where Self: Sized, K1: Into<CommandArg>, K2: Into<CommandArg>,

Renames key to newkey if newkey does not yet exist. It returns an error when key does not exist. Read more
Source§

fn restore<K>( &mut self, key: K, ttl: u64, serialized_value: Vec<u8>, options: RestoreOptions, ) -> PreparedCommand<'_, Self, ()>
where Self: Sized, K: Into<CommandArg>,

Create a key associated with a value that is obtained by deserializing the provided serialized value (obtained via DUMP). Read more
Source§

fn scan<K, A>( &mut self, cursor: u64, options: ScanOptions, ) -> PreparedCommand<'_, Self, (u64, A)>
where Self: Sized, K: FromValue, A: FromSingleValueArray<K>,

Iterates the set of keys in the currently selected Redis database. Read more
Source§

fn sort<K, M, A>( &mut self, key: K, options: SortOptions, ) -> PreparedCommand<'_, Self, A>
where Self: Sized, K: Into<CommandArg>, M: FromValue, A: FromSingleValueArray<M>,

Returns the elements contained in the list, set or sorted set at key. Read more
Source§

fn sort_and_store<K, D>( &mut self, key: K, destination: D, options: SortOptions, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, D: Into<CommandArg>,

Stores the elements contained in the list, set or sorted set at key. Read more
Source§

fn sort_readonly<K, M, A>( &mut self, key: K, options: SortOptions, ) -> PreparedCommand<'_, Self, A>
where Self: Sized, K: Into<CommandArg>, M: FromValue, A: FromSingleValueArray<M>,

Read-only variant of the SORT command. Read more
Source§

fn touch<K, KK>(&mut self, keys: KK) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, KK: SingleArgOrCollection<K>,

Alters the last access time of a key(s). A key is ignored if it does not exist. Read more
Source§

fn ttl<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
where Self: Sized, K: Into<CommandArg>,

Returns the remaining time to live of a key that has a timeout. Read more
Source§

fn type_<K>(&mut self, key: K) -> PreparedCommand<'_, Self, String>
where Self: Sized, K: Into<CommandArg>,

Returns the string representation of the type of the value stored at key. Read more
This command is very similar to DEL: it removes the specified keys. Read more
Source§

fn wait( &mut self, num_replicas: usize, timeout: u64, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized,

This command blocks the current client until all the previous write commands are successfully transferred and acknowledged by at least the specified number of replicas. Read more
Source§

impl GeoCommands for Transaction

Source§

fn geoadd<K, M, I>( &mut self, key: K, condition: GeoAddCondition, change: bool, items: I, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, M: Into<CommandArg>, I: ArgsOrCollection<(f64, f64, M)>,

Adds the specified geospatial items (longitude, latitude, name) to the specified key. Read more
Source§

fn geodist<K, M>( &mut self, key: K, member1: M, member2: M, unit: GeoUnit, ) -> PreparedCommand<'_, Self, Option<f64>>
where Self: Sized, K: Into<CommandArg>, M: Into<CommandArg>,

Return the distance between two members in the geospatial index represented by the sorted set. Read more
Source§

fn geohash<K, M, C>( &mut self, key: K, members: C, ) -> PreparedCommand<'_, Self, Vec<String>>

Return valid Geohash strings representing the position of one or more elements in a sorted set value representing a geospatial index (where elements were added using geoadd). Read more
Source§

fn geopos<K, M, C>( &mut self, key: K, members: C, ) -> PreparedCommand<'_, Self, Vec<Option<(f64, f64)>>>

Return the positions (longitude,latitude) of all the specified members of the geospatial index represented by the sorted set at key. Read more
Source§

fn geosearch<K, M1, M2, A>( &mut self, key: K, from: GeoSearchFrom<M1>, by: GeoSearchBy, options: GeoSearchOptions, ) -> PreparedCommand<'_, Self, A>

Return the members of a sorted set populated with geospatial information using geoadd, which are within the borders of the area specified by a given shape. Read more
Source§

fn geosearchstore<D, S, M>( &mut self, destination: D, source: S, from: GeoSearchFrom<M>, by: GeoSearchBy, options: GeoSearchStoreOptions, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, D: Into<CommandArg>, S: Into<CommandArg>, M: Into<CommandArg>,

This command is like geosearch, but stores the result in destination key. Read more
Source§

impl HashCommands for Transaction

Source§

fn hdel<K, F, C>( &mut self, key: K, fields: C, ) -> PreparedCommand<'_, Self, usize>

Removes the specified fields from the hash stored at key. Read more
Source§

fn hexists<K, F>(&mut self, key: K, field: F) -> PreparedCommand<'_, Self, bool>
where Self: Sized, K: Into<CommandArg>, F: Into<CommandArg>,

Returns if field is an existing field in the hash stored at key. Read more
Source§

fn hget<K, F, V>(&mut self, key: K, field: F) -> PreparedCommand<'_, Self, V>
where Self: Sized, K: Into<CommandArg>, F: Into<CommandArg>, V: FromValue,

Returns the value associated with field in the hash stored at key. Read more
Source§

fn hgetall<K, F, V, A>(&mut self, key: K) -> PreparedCommand<'_, Self, A>
where Self: Sized, K: Into<CommandArg>, F: FromValue, V: FromValue, A: FromKeyValueValueArray<F, V>,

Returns all fields and values of the hash stored at key. Read more
Source§

fn hincrby<K, F>( &mut self, key: K, field: F, increment: i64, ) -> PreparedCommand<'_, Self, i64>
where Self: Sized, K: Into<CommandArg>, F: Into<CommandArg>,

Increments the number stored at field in the hash stored at key by increment. Read more
Source§

fn hincrbyfloat<K, F>( &mut self, key: K, field: F, increment: f64, ) -> PreparedCommand<'_, Self, f64>
where Self: Sized, K: Into<CommandArg>, F: Into<CommandArg>,

Increment the specified field of a hash stored at key, and representing a floating point number, by the specified increment. Read more
Source§

fn hkeys<K, F, A>(&mut self, key: K) -> PreparedCommand<'_, Self, A>
where Self: Sized, K: Into<CommandArg>, F: FromValue, A: FromSingleValueArray<F>,

Returns all field names in the hash stored at key. Read more
Source§

fn hlen<K>(&mut self, key: K) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>,

Returns the number of fields contained in the hash stored at key. Read more
Source§

fn hmget<K, F, V, C, A>( &mut self, key: K, fields: C, ) -> PreparedCommand<'_, Self, A>

Returns the values associated with the specified fields in the hash stored at key. Read more
Source§

fn hrandfield<K, F>(&mut self, key: K) -> PreparedCommand<'_, Self, F>
where Self: Sized, K: Into<CommandArg>, F: FromValue,

return random fields from the hash value stored at key. Read more
Source§

fn hrandfields<K, F, A>( &mut self, key: K, count: isize, ) -> PreparedCommand<'_, Self, A>
where Self: Sized, K: Into<CommandArg>, F: FromValue, A: FromSingleValueArray<F>,

return random fields from the hash value stored at key. Read more
Source§

fn hrandfields_with_values<K, F, V, A>( &mut self, key: K, count: isize, ) -> PreparedCommand<'_, Self, A>
where Self: Sized, K: Into<CommandArg>, F: FromValue, V: FromValue, A: FromKeyValueValueArray<F, V>,

return random fields from the hash value stored at key. Read more
Source§

fn hscan<K, F, V>( &mut self, key: K, cursor: u64, options: HScanOptions, ) -> PreparedCommand<'_, Self, (u64, Vec<(F, V)>)>
where Self: Sized, K: Into<CommandArg>, F: FromValue, V: FromValue,

Iterates fields of Hash types and their associated values. Read more
Source§

fn hset<K, F, V, I>( &mut self, key: K, items: I, ) -> PreparedCommand<'_, Self, usize>

Sets field in the hash stored at key to value. Read more
Source§

fn hsetnx<K, F, V>( &mut self, key: K, field: F, value: V, ) -> PreparedCommand<'_, Self, bool>
where Self: Sized, K: Into<CommandArg>, F: Into<CommandArg>, V: Into<CommandArg>,

Sets field in the hash stored at key to value, only if field does not yet exist. Read more
Source§

fn hstrlen<K, F>( &mut self, key: K, field: F, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, F: Into<CommandArg>,

Returns the string length of the value associated with field in the hash stored at key. Read more
Source§

fn hvals<K, V, A>(&mut self, key: K) -> PreparedCommand<'_, Self, A>
where Self: Sized, K: Into<CommandArg>, V: FromValue, A: FromSingleValueArray<V>,

list of values in the hash, or an empty list when key does not exist. Read more
Source§

impl HyperLogLogCommands for Transaction

Source§

fn pfadd<K, E, EE>( &mut self, key: K, elements: EE, ) -> PreparedCommand<'_, Self, bool>
where Self: Sized, K: Into<CommandArg>, E: Into<CommandArg>, EE: SingleArgOrCollection<E>,

Adds the specified elements to the specified HyperLogLog. Read more
Source§

fn pfcount<K, KK>(&mut self, keys: KK) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, KK: SingleArgOrCollection<K>,

Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s). Read more
Source§

fn pfmerge<D, S, SS>( &mut self, dest_key: D, source_keys: SS, ) -> PreparedCommand<'_, Self, ()>
where Self: Sized, D: Into<CommandArg>, S: Into<CommandArg>, SS: SingleArgOrCollection<S>,

Merge N different HyperLogLogs into a single one. Read more
Source§

impl ListCommands for Transaction

Source§

fn lindex<K, E>(&mut self, key: K, index: isize) -> PreparedCommand<'_, Self, E>
where Self: Sized, K: Into<CommandArg>, E: FromValue,

Returns the element at index index in the list stored at key. Read more
Source§

fn linsert<K, E>( &mut self, key: K, where_: LInsertWhere, pivot: E, element: E, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, E: Into<CommandArg>,

Inserts element in the list stored at key either before or after the reference value pivot. Read more
Source§

fn llen<K>(&mut self, key: K) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>,

Inserts element in the list stored at key either before or after the reference value pivot. Read more
Source§

fn lmove<S, D, E>( &mut self, source: S, destination: D, where_from: LMoveWhere, where_to: LMoveWhere, ) -> PreparedCommand<'_, Self, E>
where Self: Sized, S: Into<CommandArg>, D: Into<CommandArg>, E: FromValue,

Atomically returns and removes the first/last element (head/tail depending on the wherefrom argument) of the list stored at source, and pushes the element at the first/last element (head/tail depending on the whereto argument) of the list stored at destination. Read more
Source§

fn lmpop<K, E, C>( &mut self, keys: C, where_: LMoveWhere, count: usize, ) -> PreparedCommand<'_, Self, (String, Vec<E>)>
where Self: Sized, K: Into<CommandArg>, E: FromValue, C: SingleArgOrCollection<K>,

Pops one or more elements from the first non-empty list key from the list of provided key names. Read more
Source§

fn lpop<K, E, A>( &mut self, key: K, count: usize, ) -> PreparedCommand<'_, Self, A>
where Self: Sized, K: Into<CommandArg>, E: FromValue, A: FromSingleValueArray<E>,

Removes and returns the first elements of the list stored at key. Read more
Source§

fn lpos<K, E>( &mut self, key: K, element: E, rank: Option<usize>, max_len: Option<usize>, ) -> PreparedCommand<'_, Self, Option<usize>>
where Self: Sized, K: Into<CommandArg>, E: Into<CommandArg>,

Returns the index of matching elements inside a Redis list. Read more
Source§

fn lpos_with_count<K, E, A>( &mut self, key: K, element: E, num_matches: usize, rank: Option<usize>, max_len: Option<usize>, ) -> PreparedCommand<'_, Self, A>

Returns the index of matching elements inside a Redis list. Read more
Source§

fn lpush<K, E, C>( &mut self, key: K, elements: C, ) -> PreparedCommand<'_, Self, usize>

Insert all the specified values at the head of the list stored at key Read more
Source§

fn lpushx<K, E, C>( &mut self, key: K, elements: C, ) -> PreparedCommand<'_, Self, usize>

Inserts specified values at the head of the list stored at key, only if key already exists and holds a list. Read more
Source§

fn lrange<K, E, A>( &mut self, key: K, start: isize, stop: isize, ) -> PreparedCommand<'_, Self, A>
where Self: Sized, K: Into<CommandArg>, E: FromValue, A: FromSingleValueArray<E>,

Returns the specified elements of the list stored at key. Read more
Source§

fn lrem<K, E>( &mut self, key: K, count: isize, element: E, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, E: Into<CommandArg>,

Removes the first count occurrences of elements equal to element from the list stored at key. Read more
Source§

fn lset<K, E>( &mut self, key: K, index: isize, element: E, ) -> PreparedCommand<'_, Self, ()>
where Self: Sized, K: Into<CommandArg>, E: Into<CommandArg>,

Sets the list element at index to element. Read more
Source§

fn ltrim<K>( &mut self, key: K, start: isize, stop: isize, ) -> PreparedCommand<'_, Self, ()>
where Self: Sized, K: Into<CommandArg>,

Trim an existing list so that it will contain only the specified range of elements specified. Read more
Source§

fn rpop<K, E, C>( &mut self, key: K, count: usize, ) -> PreparedCommand<'_, Self, C>
where Self: Sized, K: Into<CommandArg>, E: FromValue, C: FromSingleValueArray<E>,

Removes and returns the first elements of the list stored at key. Read more
Source§

fn rpush<K, E, C>( &mut self, key: K, elements: C, ) -> PreparedCommand<'_, Self, usize>

Insert all the specified values at the tail of the list stored at key Read more
Source§

fn rpushx<K, E, C>( &mut self, key: K, elements: C, ) -> PreparedCommand<'_, Self, usize>

Inserts specified values at the tail of the list stored at key, only if key already exists and holds a list. Read more
Source§

impl ScriptingCommands for Transaction

Source§

fn eval<R>(&mut self, builder: CallBuilder) -> PreparedCommand<'_, Self, R>
where Self: Sized, R: FromValue,

Invoke the execution of a server-side Lua script. Read more
Source§

fn eval_readonly<R>( &mut self, builder: CallBuilder, ) -> PreparedCommand<'_, Self, R>
where Self: Sized, R: FromValue,

This is a read-only variant of the eval] command that cannot execute commands that modify data. Read more
Source§

fn evalsha<R>(&mut self, builder: CallBuilder) -> PreparedCommand<'_, Self, R>
where Self: Sized, R: FromValue,

Evaluate a script from the server’s cache by its SHA1 digest. Read more
Source§

fn evalsha_readonly<R>( &mut self, builder: CallBuilder, ) -> PreparedCommand<'_, Self, R>
where Self: Sized, R: FromValue,

This is a read-only variant of the evalsha command that cannot execute commands that modify data. Read more
Source§

fn fcall<R>(&mut self, builder: CallBuilder) -> PreparedCommand<'_, Self, R>
where Self: Sized, R: FromValue,

Invoke a function. Read more
Source§

fn fcall_readonly<R>( &mut self, builder: CallBuilder, ) -> PreparedCommand<'_, Self, R>
where Self: Sized, R: FromValue,

Invoke a function. Read more
Source§

fn function_delete<L>( &mut self, library_name: L, ) -> PreparedCommand<'_, Self, ()>
where Self: Sized, L: Into<CommandArg>,

Delete a library and all its functions. Read more
Source§

fn function_dump<P>(&mut self) -> PreparedCommand<'_, Self, P>
where Self: Sized, P: FromValue,

Return the serialized payload of loaded libraries. You can restore the serialized payload later with the function_restore command. Read more
Source§

fn function_flush( &mut self, flushing_mode: FlushingMode, ) -> PreparedCommand<'_, Self, ()>
where Self: Sized,

Deletes all the libraries. Read more
Source§

fn function_kill(&mut self) -> PreparedCommand<'_, Self, ()>
where Self: Sized,

Kill a function that is currently executing. Read more
Source§

fn function_list( &mut self, options: FunctionListOptions, ) -> PreparedCommand<'_, Self, Vec<LibraryInfo>>
where Self: Sized,

Return information about the functions and libraries. Read more
Source§

fn function_load<F, L>( &mut self, replace: bool, function_code: F, ) -> PreparedCommand<'_, Self, L>
where Self: Sized, F: Into<CommandArg>, L: FromValue,

Load a library to Redis. Read more
Source§

fn function_restore<P>( &mut self, serialized_payload: P, policy: FunctionRestorePolicy, ) -> PreparedCommand<'_, Self, ()>
where Self: Sized, P: Into<CommandArg>,

Restore libraries from the serialized payload. Read more
Source§

fn function_stats(&mut self) -> PreparedCommand<'_, Self, FunctionStats>
where Self: Sized,

Return information about the function that’s currently running and information about the available execution engines. Read more
Source§

fn script_debug( &mut self, debug_mode: ScriptDebugMode, ) -> PreparedCommand<'_, Self, ()>
where Self: Sized,

Set the debug mode for subsequent scripts executed with EVAL. Read more
Source§

fn script_exists<S, C>( &mut self, sha1s: C, ) -> PreparedCommand<'_, Self, Vec<bool>>
where Self: Sized, S: Into<CommandArg>, C: SingleArgOrCollection<S>,

Returns information about the existence of the scripts in the script cache. Read more
Source§

fn script_flush( &mut self, flushing_mode: FlushingMode, ) -> PreparedCommand<'_, Self, ()>
where Self: Sized,

Flush the Lua scripts cache. Read more
Source§

fn script_kill(&mut self) -> PreparedCommand<'_, Self, ()>
where Self: Sized,

Kills the currently executing EVAL script, assuming no write operation was yet performed by the script. Read more
Source§

fn script_load<S, V>(&mut self, script: S) -> PreparedCommand<'_, Self, V>
where Self: Sized, S: Into<CommandArg>, V: FromValue,

Load a script into the scripts cache, without executing it. Read more
Source§

impl ServerCommands for Transaction

Source§

fn acl_cat<C, CC>( &mut self, options: AclCatOptions, ) -> PreparedCommand<'_, Self, CC>
where Self: Sized, 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. Read more
Source§

fn acl_deluser<U, UU>( &mut self, usernames: UU, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, U: Into<CommandArg>, UU: SingleArgOrCollection<U>,

Delete all the specified ACL users and terminate all the connections that are authenticated with such users. Read more
Source§

fn acl_dryrun<U, C, R>( &mut self, username: U, command: C, options: AclDryRunOptions, ) -> PreparedCommand<'_, Self, R>
where Self: Sized, U: Into<CommandArg>, C: Into<CommandArg>, R: FromValue,

Simulate the execution of a given command by a given user. Read more
Source§

fn acl_genpass<R: FromValue>( &mut self, options: AclGenPassOptions, ) -> PreparedCommand<'_, 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. Read more
Source§

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

The command returns all the rules defined for an existing ACL user. Read more
Source§

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

The command shows the currently active ACL rules in the Redis server. Read more
Source§

fn acl_load(&mut self) -> PreparedCommand<'_, 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. Read more
Source§

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

The command shows a list of recent ACL security events Read more
Source§

fn acl_save(&mut self) -> PreparedCommand<'_, 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. Read more
Source§

fn acl_setuser<U, R, RR>( &mut self, username: U, rules: RR, ) -> PreparedCommand<'_, Self, ()>
where Self: Sized, U: Into<CommandArg>, R: Into<CommandArg>, RR: SingleArgOrCollection<R>,

Create an ACL user with the specified rules or modify the rules of an existing user. Read more
Source§

fn acl_users<U, UU>(&mut self) -> PreparedCommand<'_, Self, UU>
where Self: Sized, U: FromValue, UU: FromSingleValueArray<U>,

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

fn acl_whoami<U: FromValue>(&mut self) -> PreparedCommand<'_, Self, U>
where Self: Sized,

Return the username the current connection is authenticated with. Read more
Source§

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

Return an array with details about every Redis command. Read more
Source§

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

Number of total commands in this Redis server. Read more
Source§

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

Number of total commands in this Redis server. Read more
Source§

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

A helper command to let you find the keys from a full Redis command. Read more
Source§

fn command_getkeysandflags<A, AA, KK>( &mut self, args: AA, ) -> PreparedCommand<'_, 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. Read more
Source§

fn command_info<N, NN>( &mut self, command_names: NN, ) -> PreparedCommand<'_, Self, Vec<CommandInfo>>
where Self: Sized, N: Into<CommandArg>, NN: SingleArgOrCollection<N>,

Return an array with details about multiple Redis command. Read more
Source§

fn command_list<CC>( &mut self, options: CommandListOptions, ) -> PreparedCommand<'_, Self, CC>
where Self: Sized, CC: FromSingleValueArray<String>,

Return an array of the server’s command names based on optional filters Read more
Source§

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

Used to read the configuration parameters of a running Redis server. Read more
Source§

fn config_resetstat(&mut self) -> PreparedCommand<'_, Self, ()>
where Self: Sized,

Resets the statistics reported by Redis using the info command. Read more
Source§

fn config_rewrite(&mut self) -> PreparedCommand<'_, 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. Read more
Source§

fn config_set<P, V, C>(&mut self, configs: C) -> PreparedCommand<'_, Self, ()>
where Self: Sized, P: Into<CommandArg>, V: Into<CommandArg>, C: KeyValueArgOrCollection<P, V>,

Used in order to reconfigure the server at run time without the need to restart Redis. Read more
Source§

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

Return the number of keys in the currently-selected database. Read more
Source§

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

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

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

Delete all the keys of the currently selected DB. Read more
Source§

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

Delete all the keys of all the existing databases, not just the currently selected one. Read more
Source§

fn info<SS>(&mut self, sections: SS) -> PreparedCommand<'_, 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. Read more
Source§

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

Return the UNIX TIME of the last DB save executed with success. Read more
Source§

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

This command reports about different latency-related issues and advises about possible remedies. Read more
Source§

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

Produces an ASCII-art style graph for the specified event. Read more
Source§

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

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

fn latency_history<RR>( &mut self, event: LatencyHistoryEvent, ) -> PreparedCommand<'_, Self, RR>
where Self: Sized, RR: FromSingleValueArray<(u32, u32)>,

This command returns the raw data of the event’s latency spikes time series. Read more
Source§

fn latency_latest<RR>(&mut self) -> PreparedCommand<'_, Self, RR>
where Self: Sized, RR: FromSingleValueArray<(String, u32, u32, u32)>,

This command reports the latest latency events logged. Read more
Source§

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

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

fn lolwut( &mut self, options: LolWutOptions, ) -> PreparedCommand<'_, 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. Read more
Source§

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

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

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

This command provides an internal statistics report from the memory allocator. Read more
Source§

fn memory_purge(&mut self) -> PreparedCommand<'_, Self, ()>
where Self: Sized,

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

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

This command returns information about the memory usage of the server. Read more
Source§

fn memory_usage<K>( &mut self, key: K, options: MemoryUsageOptions, ) -> PreparedCommand<'_, Self, Option<usize>>
where Self: Sized, K: Into<CommandArg>,

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

fn module_list<MM>(&mut self) -> PreparedCommand<'_, Self, MM>

Returns information about the modules loaded to the server. Read more
Source§

fn module_load<P>( &mut self, path: P, options: ModuleLoadOptions, ) -> PreparedCommand<'_, Self, ()>
where Self: Sized, P: Into<CommandArg>,

Loads a module from a dynamic library at runtime. Read more
Source§

fn module_unload<N>(&mut self, name: N) -> PreparedCommand<'_, Self, ()>
where Self: Sized, N: Into<CommandArg>,

Unloads a module. Read more
Source§

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

This command can change the replication settings of a replica on the fly. Read more
Source§

fn role(&mut self) -> PreparedCommand<'_, 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. Read more
Source§

fn save(&mut self) -> PreparedCommand<'_, 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. Read more
Source§

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

Shutdown the server Read more
Source§

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

This command returns entries from the slow log in chronological order. Read more
Source§

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

This command returns the current number of entries in the slow log. Read more
Source§

fn slowlog_reset(&mut self) -> PreparedCommand<'_, Self, ()>
where Self: Sized,

This command resets the slow log, clearing all entries in it. Read more
Source§

fn swapdb( &mut self, index1: usize, index2: usize, ) -> PreparedCommand<'_, 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. Read more
Source§

fn time(&mut self) -> PreparedCommand<'_, 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. Read more
Source§

impl SetCommands for Transaction

Source§

fn sadd<K, M, C>( &mut self, key: K, members: C, ) -> PreparedCommand<'_, Self, usize>

Add the specified members to the set stored at key. Read more
Source§

fn scard<K>(&mut self, key: K) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>,

Returns the set cardinality (number of elements) of the set stored at key. Read more
Source§

fn sdiff<K, M, C, A>(&mut self, keys: C) -> PreparedCommand<'_, Self, A>

Returns the members of the set resulting from the difference between the first set and all the successive sets. Read more
Source§

fn sdiffstore<D, K, C>( &mut self, destination: D, keys: C, ) -> PreparedCommand<'_, Self, usize>

This command is equal to sdiff, but instead of returning the resulting set, it is stored in destination. Read more
Source§

fn sinter<K, M, C, A>(&mut self, keys: C) -> PreparedCommand<'_, Self, A>

Returns the members of the set resulting from the intersection of all the given sets. Read more
Source§

fn sintercard<K, C>( &mut self, keys: C, limit: usize, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, C: SingleArgOrCollection<K>,

This command is similar to sinter, but instead of returning the result set, it returns just the cardinality of the result. Read more
Source§

fn sinterstore<D, K, C>( &mut self, destination: D, keys: C, ) -> PreparedCommand<'_, Self, usize>

This command is equal to sinter, but instead of returning the resulting set, it is stored in destination. Read more
Source§

fn sismember<K, M>( &mut self, key: K, member: M, ) -> PreparedCommand<'_, Self, bool>
where Self: Sized, K: Into<CommandArg>, M: Into<CommandArg>,

Returns if member is a member of the set stored at key. Read more
Source§

fn smembers<K, M, A>(&mut self, key: K) -> PreparedCommand<'_, Self, A>
where Self: Sized, K: Into<CommandArg>, M: FromValue + Eq + Hash, A: FromSingleValueArray<M>,

Returns all the members of the set value stored at key. Read more
Source§

fn smismember<K, M, C>( &mut self, key: K, members: C, ) -> PreparedCommand<'_, Self, Vec<bool>>

Returns whether each member is a member of the set stored at key. Read more
Source§

fn smove<S, D, M>( &mut self, source: S, destination: D, member: M, ) -> PreparedCommand<'_, Self, bool>
where Self: Sized, S: Into<CommandArg>, D: Into<CommandArg>, M: Into<CommandArg>,

Move member from the set at source to the set at destination. Read more
Source§

fn spop<K, M, A>( &mut self, key: K, count: usize, ) -> PreparedCommand<'_, Self, A>
where Self: Sized, K: Into<CommandArg>, M: FromValue + Eq + Hash, A: FromSingleValueArray<M>,

Removes and returns one or more random members from the set value store at key. Read more
Source§

fn srandmember<K, M, A>( &mut self, key: K, count: usize, ) -> PreparedCommand<'_, Self, A>
where Self: Sized, K: Into<CommandArg>, M: FromValue + Eq + Hash, A: FromSingleValueArray<M>,

Removes and returns one or more random members from the set value store at key. Read more
Source§

fn srem<K, M, C>( &mut self, key: K, members: C, ) -> PreparedCommand<'_, Self, usize>

Remove the specified members from the set stored at key. Read more
Source§

fn sscan<K, M>( &mut self, key: K, cursor: u64, options: SScanOptions, ) -> PreparedCommand<'_, Self, (u64, Vec<M>)>
where Self: Sized, K: Into<CommandArg>, M: FromValue,

Iterates elements of Sets types. Read more
Source§

fn sunion<K, M, C, A>(&mut self, keys: C) -> PreparedCommand<'_, Self, A>

Returns the members of the set resulting from the union of all the given sets. Read more
Source§

fn sunionstore<D, K, C>( &mut self, destination: D, keys: C, ) -> PreparedCommand<'_, Self, usize>

This command is equal to sunion, but instead of returning the resulting set, it is stored in destination. Read more
Source§

impl SortedSetCommands for Transaction

Source§

fn zadd<K, M, I>( &mut self, key: K, items: I, options: ZAddOptions, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, M: Into<CommandArg>, I: ArgsOrCollection<(f64, M)>,

Adds all the specified members with the specified scores to the sorted set stored at key. Read more
Source§

fn zadd_incr<K, M>( &mut self, key: K, condition: ZAddCondition, comparison: ZAddComparison, change: bool, score: f64, member: M, ) -> PreparedCommand<'_, Self, Option<f64>>
where Self: Sized, K: Into<CommandArg>, M: Into<CommandArg>,

In this mode ZADD acts like ZINCRBY. Only one score-element pair can be specified in this mode. Read more
Source§

fn zcard<K>(&mut self, key: K) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>,

Returns the sorted set cardinality (number of elements) of the sorted set stored at key. Read more
Source§

fn zcount<K, M1, M2>( &mut self, key: K, min: M1, max: M2, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, M1: Into<CommandArg>, M2: Into<CommandArg>,

Returns the number of elements in the sorted set at key with a score between min and max. Read more
Source§

fn zdiff<K, C, E>(&mut self, keys: C) -> PreparedCommand<'_, Self, Vec<E>>
where Self: Sized, K: Into<CommandArg>, C: SingleArgOrCollection<K>, E: FromValue,

This command is similar to zdiffstore, but instead of storing the resulting sorted set, it is returned to the client. Read more
Source§

fn zdiff_with_scores<K, C, E>( &mut self, keys: C, ) -> PreparedCommand<'_, Self, Vec<(E, f64)>>
where Self: Sized, K: Into<CommandArg>, C: SingleArgOrCollection<K>, E: FromValue,

This command is similar to zdiffstore, but instead of storing the resulting sorted set, it is returned to the client. Read more
Source§

fn zdiffstore<D, K, C>( &mut self, destination: D, keys: C, ) -> PreparedCommand<'_, Self, usize>

Computes the difference between the first and all successive input sorted sets and stores the result in destination. Read more
Source§

fn zincrby<K, M>( &mut self, key: K, increment: f64, member: M, ) -> PreparedCommand<'_, Self, f64>
where Self: Sized, K: Into<CommandArg>, M: Into<CommandArg>,

Increments the score of member in the sorted set stored at key by increment. Read more
Source§

fn zinter<K, C, W, E>( &mut self, keys: C, weights: Option<W>, aggregate: ZAggregate, ) -> PreparedCommand<'_, Self, Vec<E>>

This command is similar to zinterstore, but instead of storing the resulting sorted set, it is returned to the client. Read more
Source§

fn zinter_with_scores<K, C, W, E>( &mut self, keys: C, weights: Option<W>, aggregate: ZAggregate, ) -> PreparedCommand<'_, Self, Vec<(E, f64)>>

This command is similar to zinterstore, but instead of storing the resulting sorted set, it is returned to the client. Read more
Source§

fn zintercard<K, C>( &mut self, keys: C, limit: usize, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, C: SingleArgOrCollection<K>,

This command is similar to zinter, but instead of returning the result set, it returns just the cardinality of the result. Read more
Source§

fn zinterstore<D, K, C, W>( &mut self, destination: D, keys: C, weights: Option<W>, aggregate: ZAggregate, ) -> PreparedCommand<'_, Self, usize>

Computes the intersection of numkeys sorted sets given by the specified keys, and stores the result in destination. Read more
Source§

fn zlexcount<K, M1, M2>( &mut self, key: K, min: M1, max: M2, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, M1: Into<CommandArg>, M2: Into<CommandArg>,

When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns the number of elements in the sorted set at key with a value between min and max. Read more
Source§

fn zmpop<K, C, E>( &mut self, keys: C, where_: ZWhere, count: usize, ) -> PreparedCommand<'_, Self, Option<ZMPopResult<E>>>
where Self: Sized, K: Into<CommandArg>, C: SingleArgOrCollection<K>, E: FromValue,

Pops one or more elements, that are member-score pairs, from the first non-empty sorted set in the provided list of key names. Read more
Source§

fn zmscore<K, M, C>( &mut self, key: K, members: C, ) -> PreparedCommand<'_, Self, Vec<Option<f64>>>

Returns the scores associated with the specified members in the sorted set stored at key. Read more
Source§

fn zpopmax<K, M>( &mut self, key: K, count: usize, ) -> PreparedCommand<'_, Self, Vec<(M, f64)>>
where Self: Sized, K: Into<CommandArg>, M: FromValue,

Removes and returns up to count members with the highest scores in the sorted set stored at key. Read more
Source§

fn zpopmin<K, M>( &mut self, key: K, count: usize, ) -> PreparedCommand<'_, Self, Vec<(M, f64)>>
where Self: Sized, K: Into<CommandArg>, M: FromValue,

Removes and returns up to count members with the lowest scores in the sorted set stored at key. Read more
Source§

fn zrandmember<K, E>(&mut self, key: K) -> PreparedCommand<'_, Self, E>
where Self: Sized, K: Into<CommandArg>, E: FromValue,

Return a random element from the sorted set value stored at key. Read more
Source§

fn zrandmembers<K, E>( &mut self, key: K, count: isize, ) -> PreparedCommand<'_, Self, Vec<E>>
where Self: Sized, K: Into<CommandArg>, E: FromValue,

Return random elements from the sorted set value stored at key. Read more
Source§

fn zrandmembers_with_scores<K, E>( &mut self, key: K, count: isize, ) -> PreparedCommand<'_, Self, Vec<E>>
where Self: Sized, K: Into<CommandArg>, E: FromValue,

Return random elements with their scores from the sorted set value stored at key. Read more
Source§

fn zrange<K, S, E>( &mut self, key: K, start: S, stop: S, options: ZRangeOptions, ) -> PreparedCommand<'_, Self, Vec<E>>
where Self: Sized, K: Into<CommandArg>, S: Into<CommandArg>, E: FromValue,

Returns the specified range of elements in the sorted set stored at key. Read more
Source§

fn zrange_with_scores<K, S, E>( &mut self, key: K, start: S, stop: S, options: ZRangeOptions, ) -> PreparedCommand<'_, Self, Vec<(E, f64)>>
where Self: Sized, K: Into<CommandArg>, S: Into<CommandArg>, E: FromValue,

Returns the specified range of elements in the sorted set stored at key. Read more
Source§

fn zrangestore<D, S, SS>( &mut self, dst: D, src: S, start: SS, stop: SS, options: ZRangeOptions, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, D: Into<CommandArg>, S: Into<CommandArg>, SS: Into<CommandArg>,

This command is like zrange, but stores the result in the dst destination key. Read more
Source§

fn zrank<K, M>( &mut self, key: K, member: M, ) -> PreparedCommand<'_, Self, Option<usize>>
where Self: Sized, K: Into<CommandArg>, M: Into<CommandArg>,

Returns the rank of member in the sorted set stored at key, with the scores ordered from low to high. Read more
Source§

fn zrem<K, M, C>( &mut self, key: K, members: C, ) -> PreparedCommand<'_, Self, usize>

Removes the specified members from the sorted set stored at key. Read more
Source§

fn zremrangebylex<K, S>( &mut self, key: K, start: S, stop: S, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, S: Into<CommandArg>,

When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command removes all elements in the sorted set stored at key between the lexicographical range specified by min and max. Read more
Source§

fn zremrangebyrank<K>( &mut self, key: K, start: isize, stop: isize, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>,

Removes all elements in the sorted set stored at key with rank between start and stop. Read more
Source§

fn zremrangebyscore<K, S>( &mut self, key: K, start: S, stop: S, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, S: Into<CommandArg>,

Removes all elements in the sorted set stored at key with a score between min and max (inclusive). Read more
Source§

fn zrevrank<K, M>( &mut self, key: K, member: M, ) -> PreparedCommand<'_, Self, Option<usize>>
where Self: Sized, K: Into<CommandArg>, M: Into<CommandArg>,

Returns the rank of member in the sorted set stored at key, with the scores ordered from high to low. Read more
Source§

fn zscan<K, M>( &mut self, key: K, cursor: usize, options: ZScanOptions, ) -> PreparedCommand<'_, Self, (u64, Vec<(M, f64)>)>
where Self: Sized, K: Into<CommandArg>, M: FromValue,

Iterates elements of Sorted Set types and their associated scores. Read more
Source§

fn zscore<K, M>( &mut self, key: K, member: M, ) -> PreparedCommand<'_, Self, Option<f64>>
where Self: Sized, K: Into<CommandArg>, M: Into<CommandArg>,

Returns the score of member in the sorted set at key. Read more
Source§

fn zunion<K, C, W, E>( &mut self, keys: C, weights: Option<W>, aggregate: ZAggregate, ) -> PreparedCommand<'_, Self, Vec<E>>

This command is similar to zunionstore, but instead of storing the resulting sorted set, it is returned to the client. Read more
Source§

fn zunion_with_scores<K, C, W, E>( &mut self, keys: C, weights: Option<W>, aggregate: ZAggregate, ) -> PreparedCommand<'_, Self, Vec<(E, f64)>>

This command is similar to zunionstore, but instead of storing the resulting sorted set, it is returned to the client. Read more
Source§

fn zunionstore<D, K, C, W>( &mut self, destination: D, keys: C, weights: Option<W>, aggregate: ZAggregate, ) -> PreparedCommand<'_, Self, usize>

Computes the unionsection of numkeys sorted sets given by the specified keys, and stores the result in destination. Read more
Source§

impl StreamCommands for Transaction

Source§

fn xack<K, G, I, II>( &mut self, key: K, group: G, ids: II, ) -> PreparedCommand<'_, Self, usize>

The XACK command removes one or multiple messages from the Pending Entries List (PEL) of a stream consumer group Read more
Source§

fn xadd<K, I, F, V, FFVV, R>( &mut self, key: K, stream_id: I, items: FFVV, options: XAddOptions, ) -> PreparedCommand<'_, Self, R>

Appends the specified stream entry to the stream at the specified key. Read more
Source§

fn xautoclaim<K, G, C, I, V>( &mut self, key: K, group: G, consumer: C, min_idle_time: u64, start: I, options: XAutoClaimOptions, ) -> PreparedCommand<'_, Self, XAutoClaimResult<V>>

This command transfers ownership of pending stream entries that match the specified criteria. Read more
Source§

fn xclaim<K, G, C, I, II, V>( &mut self, key: K, group: G, consumer: C, min_idle_time: u64, ids: II, options: XClaimOptions, ) -> PreparedCommand<'_, Self, Vec<StreamEntry<V>>>

In the context of a stream consumer group, this command changes the ownership of a pending message, so that the new owner is the consumer specified as the command argument. Read more
Source§

fn xdel<K, I, II>( &mut self, key: K, ids: II, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, I: Into<CommandArg>, II: SingleArgOrCollection<I>,

Removes the specified entries from a stream, and returns the number of entries deleted. Read more
Source§

fn xgroup_create<K, G, I>( &mut self, key: K, groupname: G, id: I, options: XGroupCreateOptions, ) -> PreparedCommand<'_, Self, bool>
where Self: Sized, K: Into<CommandArg>, G: Into<CommandArg>, I: Into<CommandArg>,

This command creates a new consumer group uniquely identified by for the stream stored at . Read more
Source§

fn xgroup_createconsumer<K, G, C>( &mut self, key: K, groupname: G, consumername: C, ) -> PreparedCommand<'_, Self, bool>
where Self: Sized, K: Into<CommandArg>, G: Into<CommandArg>, C: Into<CommandArg>,

Create a consumer named consumername in the consumer group groupname`` of the stream that's stored at key. Read more
Source§

fn xgroup_delconsumer<K, G, C>( &mut self, key: K, groupname: G, consumername: C, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, G: Into<CommandArg>, C: Into<CommandArg>,

The XGROUP DELCONSUMER command deletes a consumer from the consumer group. Read more
Source§

fn xgroup_destroy<K, G>( &mut self, key: K, groupname: G, ) -> PreparedCommand<'_, Self, bool>
where Self: Sized, K: Into<CommandArg>, G: Into<CommandArg>,

The XGROUP DESTROY command completely destroys a consumer group. Read more
Source§

fn xgroup_setid<K, G, I>( &mut self, key: K, groupname: G, id: I, entries_read: Option<usize>, ) -> PreparedCommand<'_, Self, ()>
where Self: Sized, K: Into<CommandArg>, G: Into<CommandArg>, I: Into<CommandArg>,

Set the last delivered ID for a consumer group. Read more
Source§

fn xinfo_consumers<K, G>( &mut self, key: K, groupname: G, ) -> PreparedCommand<'_, Self, Vec<XConsumerInfo>>
where Self: Sized, K: Into<CommandArg>, G: Into<CommandArg>,

This command returns the list of consumers that belong to the groupname consumer group of the stream stored at key. Read more
Source§

fn xinfo_groups<K>( &mut self, key: K, ) -> PreparedCommand<'_, Self, Vec<XGroupInfo>>
where Self: Sized, K: Into<CommandArg>,

This command returns the list of consumers that belong to the groupname consumer group of the stream stored at key. Read more
Source§

fn xinfo_stream<K>( &mut self, key: K, options: XInfoStreamOptions, ) -> PreparedCommand<'_, Self, XStreamInfo>
where Self: Sized, K: Into<CommandArg>,

This command returns information about the stream stored at key. Read more
Source§

fn xlen<K>(&mut self, key: K) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>,

Returns the number of entries inside a stream. Read more
Source§

fn xpending<K, G>( &mut self, key: K, group: G, ) -> PreparedCommand<'_, Self, XPendingResult>
where Self: Sized, K: Into<CommandArg>, G: Into<CommandArg>,

The XPENDING command is the interface to inspect the list of pending messages. Read more
Source§

fn xpending_with_options<K, G>( &mut self, key: K, group: G, options: XPendingOptions, ) -> PreparedCommand<'_, Self, Vec<XPendingMessageResult>>
where Self: Sized, K: Into<CommandArg>, G: Into<CommandArg>,

The XPENDING command is the interface to inspect the list of pending messages. Read more
Source§

fn xrange<K, S, E, V>( &mut self, key: K, start: S, end: E, count: Option<usize>, ) -> PreparedCommand<'_, Self, Vec<StreamEntry<V>>>
where Self: Sized, K: Into<CommandArg>, S: Into<CommandArg>, E: Into<CommandArg>, V: FromValue,

The command returns the stream entries matching a given range of IDs. Read more
Source§

fn xread<K, KK, I, II, V, R>( &mut self, options: XReadOptions, keys: KK, ids: II, ) -> PreparedCommand<'_, Self, R>

Read data from one or multiple streams, only returning entries with an ID greater than the last received ID reported by the caller. Read more
Source§

fn xreadgroup<G, C, K, KK, I, II, V, R>( &mut self, group: G, consumer: C, options: XReadGroupOptions, keys: KK, ids: II, ) -> PreparedCommand<'_, Self, R>

The XREADGROUP command is a special version of the xread command with support for consumer groups. Read more
Source§

fn xrevrange<K, E, S, V>( &mut self, key: K, end: E, start: S, count: Option<usize>, ) -> PreparedCommand<'_, Self, Vec<StreamEntry<V>>>
where Self: Sized, K: Into<CommandArg>, E: Into<CommandArg>, S: Into<CommandArg>, V: FromValue,

This command is exactly like xrange, but with the notable difference of returning the entries in reverse order, and also taking the start-end range in reverse order Read more
Source§

fn xtrim<K>( &mut self, key: K, options: XTrimOptions, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>,

XTRIM trims the stream by evicting older entries (entries with lower IDs) if needed. Read more
Source§

impl StringCommands for Transaction

Source§

fn append<K, V>(&mut self, key: K, value: V) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, V: Into<CommandArg>,

If key already exists and is a string, this command appends the value at the end of the string. If key does not exist it is created and set as an empty string, so APPEND will be similar to SET in this special case. Read more
Source§

fn decr<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
where Self: Sized, K: Into<CommandArg>,

Decrements the number stored at key by one. Read more
Source§

fn decrby<K>( &mut self, key: K, decrement: i64, ) -> PreparedCommand<'_, Self, i64>
where Self: Sized, K: Into<CommandArg>,

Decrements the number stored at key by one. Read more
Source§

fn get<K, V>(&mut self, key: K) -> PreparedCommand<'_, Self, V>
where Self: Sized, K: Into<CommandArg>, V: FromValue,

Get the value of key. Read more
Source§

fn getdel<K, V>(&mut self, key: K) -> PreparedCommand<'_, Self, V>
where Self: Sized, K: Into<CommandArg>, V: FromValue,

Get the value of key and delete the key. Read more
Source§

fn getex<K, V>( &mut self, key: K, options: GetExOptions, ) -> PreparedCommand<'_, Self, V>
where Self: Sized, K: Into<CommandArg>, V: FromValue,

Get the value of key and optionally set its expiration. GETEX is similar to GET, but is a write command with additional options. Read more
Source§

fn getrange<K, V>( &mut self, key: K, start: usize, end: isize, ) -> PreparedCommand<'_, Self, V>
where Self: Sized, K: Into<CommandArg>, V: FromValue,

Returns the substring of the string value stored at key, determined by the offsets start and end (both are inclusive). Read more
Source§

fn getset<K, V, R>(&mut self, key: K, value: V) -> PreparedCommand<'_, Self, R>
where Self: Sized, K: Into<CommandArg>, V: Into<CommandArg>, R: FromValue,

Atomically sets key to value and returns the old value stored at key. Returns an error when key exists but does not hold a string value. Any previous time to live associated with the key is discarded on successful SET operation. Read more
Source§

fn incr<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
where Self: Sized, K: Into<CommandArg>,

Increments the number stored at key by one. Read more
Source§

fn incrby<K>( &mut self, key: K, increment: i64, ) -> PreparedCommand<'_, Self, i64>
where Self: Sized, K: Into<CommandArg>,

Increments the number stored at key by increment. Read more
Source§

fn incrbyfloat<K>( &mut self, key: K, increment: f64, ) -> PreparedCommand<'_, Self, f64>
where Self: Sized, K: Into<CommandArg>,

Increment the string representing a floating point number stored at key by the specified increment. By using a negative increment value, the result is that the value stored at the key is decremented (by the obvious properties of addition). If the key does not exist, it is set to 0 before performing the operation. An error is returned if one of the following conditions occur: Read more
Source§

fn lcs<K, V>(&mut self, key1: K, key2: K) -> PreparedCommand<'_, Self, V>
where Self: Sized, K: Into<CommandArg>, V: FromValue,

The LCS command implements the longest common subsequence algorithm Read more
Source§

fn lcs_len<K>(&mut self, key1: K, key2: K) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>,

The LCS command implements the longest common subsequence algorithm Read more
Source§

fn lcs_idx<K>( &mut self, key1: K, key2: K, min_match_len: Option<usize>, with_match_len: bool, ) -> PreparedCommand<'_, Self, LcsResult>
where Self: Sized, K: Into<CommandArg>,

The LCS command implements the longest common subsequence algorithm Read more
Source§

fn mget<K, KK, V, VV>(&mut self, keys: KK) -> PreparedCommand<'_, Self, VV>

Returns the values of all specified keys. Read more
Source§

fn mset<K, V, C>(&mut self, items: C) -> PreparedCommand<'_, Self, ()>
where Self: Sized, C: KeyValueArgOrCollection<K, V>, K: Into<CommandArg>, V: Into<CommandArg>,

Sets the given keys to their respective values. Read more
Source§

fn msetnx<K, V, C>(&mut self, items: C) -> PreparedCommand<'_, Self, bool>
where Self: Sized, C: KeyValueArgOrCollection<K, V>, K: Into<CommandArg>, V: Into<CommandArg>,

Sets the given keys to their respective values. MSETNX will not perform any operation at all even if just a single key already exists. Read more
Source§

fn psetex<K, V>( &mut self, key: K, milliseconds: u64, value: V, ) -> PreparedCommand<'_, Self, ()>
where Self: Sized, K: Into<CommandArg>, V: Into<CommandArg>,

Works exactly like setex with the sole difference that the expire time is specified in milliseconds instead of seconds. Read more
Source§

fn set<K, V>(&mut self, key: K, value: V) -> PreparedCommand<'_, Self, ()>
where Self: Sized, K: Into<CommandArg>, V: Into<CommandArg>,

Set key to hold the string value. Read more
Source§

fn set_with_options<K, V>( &mut self, key: K, value: V, condition: SetCondition, expiration: SetExpiration, keep_ttl: bool, ) -> PreparedCommand<'_, Self, bool>
where Self: Sized, K: Into<CommandArg>, V: Into<CommandArg>,

Set key to hold the string value. Read more
Source§

fn set_get_with_options<K, V1, V2>( &mut self, key: K, value: V1, condition: SetCondition, expiration: SetExpiration, keep_ttl: bool, ) -> PreparedCommand<'_, Self, V2>
where Self: Sized, K: Into<CommandArg>, V1: Into<CommandArg>, V2: FromValue,

Set key to hold the string value wit GET option enforced Read more
Source§

fn setex<K, V>( &mut self, key: K, seconds: u64, value: V, ) -> PreparedCommand<'_, Self, ()>
where Self: Sized, K: Into<CommandArg>, V: Into<CommandArg>,

Set key to hold the string value and set key to timeout after a given number of seconds. Read more
Source§

fn setnx<K, V>(&mut self, key: K, value: V) -> PreparedCommand<'_, Self, bool>
where Self: Sized, K: Into<CommandArg>, V: Into<CommandArg>,

Set key to hold string value if key does not exist. Read more
Source§

fn setrange<K, V>( &mut self, key: K, offset: usize, value: V, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, V: Into<CommandArg>,

Overwrites part of the string stored at key, starting at the specified offset, for the entire length of value. Read more
Source§

fn strlen<K>(&mut self, key: K) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>,

Returns the length of the string value stored at key. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,