pub struct Database { /* private fields */ }

Implementations

Set of Redis commands related to a specific database

The numeric identifier of this database

Send an arbitrary command to the server.

This is used primarily intended for implementing high level commands API but may also be used to provide access to new features that lack a direct API.

Arguments
  • name - Command name in uppercase.
  • args - Command arguments which can be provided as arrays (up to 4 elements) or vectors of BulkString.
Example
let connection = ConnectionMultiplexer::connect("127.0.0.1:6379").await?;
let database = connection.get_default_database();

let values: Vec<String> = database
    .send(cmd("MGET").arg("key1").arg("key2").arg("key3").arg("key4"))
    .await?
    .into()?;

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

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

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

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

Decrements the number stored at key by one. Read more

Decrements the number stored at key by one. Read more

Get the value of key. Read more

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

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

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

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

Increments the number stored at key by one. Read more

Increments the number stored at key by increment. Read more

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

The LCS command implements the longest common subsequence algorithm Read more

Returns the values of all specified keys. Read more

Sets the given keys to their respective values. Read more

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

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

Set key to hold the string value. Read more

Set key to hold the string value. Read more

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

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

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

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more