pub struct Connection<D: Database>(/* private fields */);
Expand description

A request guard which retrieves a single connection to a Database.

For a database type of Db, a request guard of Connection<Db> retrieves a single connection to Db.

The request guard succeeds if the database was initialized by the Initializer fairing and a connection is available within connect_timeout seconds.

  • If the Initializer fairing was not attached, the guard fails with status InternalServerError. A Sentinel guards this condition, and so this type of error is unlikely to occur. A None error is returned.
  • If a connection is not available within connect_timeout seconds or another error occurs, the guard fails with status ServiceUnavailable and the error is returned in Some.

§Deref

A type of Connection<Db> dereferences, mutably and immutably, to the native database connection type. The driver table lists the concrete native Deref types.

§Example

use rocket_db_pools::{Database, Connection};

#[derive(Database)]
#[database("db")]
struct Db(Pool);

#[get("/")]
async fn db_op(db: Connection<Db>) {
    // use `&*db` to get an immutable borrow to the native connection type
    // use `&mut *db` to get a mutable borrow to the native connection type
}

Implementations§

source§

impl<D: Database> Connection<D>

source

pub fn into_inner(self) -> <D::Pool as Pool>::Connection

Returns the internal connection value. See the Connection Deref column for the expected type of this value.

Note that Connection<D> derefs to the internal connection type, so using this method is likely unnecessary. See deref for examples.

§Example
use rocket_db_pools::{Database, Connection};

#[derive(Database)]
#[database("db")]
struct Db(Pool);

#[get("/")]
async fn db_op(db: Connection<Db>) {
    let inner = db.into_inner();
}

Trait Implementations§

source§

impl<D: Database> Deref for Connection<D>

§

type Target = <<D as Database>::Pool as Pool>::Connection

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<D: Database> DerefMut for Connection<D>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<'r, D: Database> FromRequest<'r> for Connection<D>

§

type Error = Option<<<D as Database>::Pool as Pool>::Error>

The associated error to be returned if derivation fails.
source§

fn from_request<'life0, 'async_trait>( req: &'r Request<'life0> ) -> Pin<Box<dyn Future<Output = Outcome<Self, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'r: 'async_trait, 'life0: 'async_trait,

Derives an instance of Self from the incoming request metadata. Read more
source§

impl<D: Database> Sentinel for Connection<D>

source§

fn abort(rocket: &Rocket<Ignite>) -> bool

Returns true if launch should be aborted and false otherwise.

Auto Trait Implementations§

§

impl<D> RefUnwindSafe for Connection<D>
where <<D as Database>::Pool as Pool>::Connection: RefUnwindSafe,

§

impl<D> Send for Connection<D>
where <<D as Database>::Pool as Pool>::Connection: Send,

§

impl<D> Sync for Connection<D>
where <<D as Database>::Pool as Pool>::Connection: Sync,

§

impl<D> Unpin for Connection<D>
where <<D as Database>::Pool as Pool>::Connection: Unpin,

§

impl<D> UnwindSafe for Connection<D>
where <<D as Database>::Pool as Pool>::Connection: UnwindSafe,

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
§

impl<'a, T> AsTaggedExplicit<'a> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self>

§

impl<'a, T> AsTaggedImplicit<'a> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32 ) -> TaggedParser<'a, Implicit, Self>

source§

impl<C> AsyncConnection for C
where C: DerefMut + Send, <C as Deref>::Target: AsyncConnection,

§

type ExecuteFuture<'conn, 'query> = <<C as Deref>::Target as AsyncConnection>::ExecuteFuture<'conn, 'query> where <C as Deref>::Target: 'conn, C: 'conn

The future returned by AsyncConnection::execute
§

type LoadFuture<'conn, 'query> = <<C as Deref>::Target as AsyncConnection>::LoadFuture<'conn, 'query> where <C as Deref>::Target: 'conn, C: 'conn

The future returned by AsyncConnection::load
§

type Stream<'conn, 'query> = <<C as Deref>::Target as AsyncConnection>::Stream<'conn, 'query> where <C as Deref>::Target: 'conn, C: 'conn

The inner stream returned by AsyncConnection::load
§

type Row<'conn, 'query> = <<C as Deref>::Target as AsyncConnection>::Row<'conn, 'query> where <C as Deref>::Target: 'conn, C: 'conn

The row type used by the stream returned by AsyncConnection::load
§

type Backend = <<C as Deref>::Target as AsyncConnection>::Backend

The backend this type connects to
§

type TransactionManager = PoolTransactionManager<<<C as Deref>::Target as AsyncConnection>::TransactionManager>

source§

fn establish<'life0, 'async_trait>( _database_url: &'life0 str ) -> Pin<Box<dyn Future<Output = Result<C, ConnectionError>> + Send + 'async_trait>>
where 'life0: 'async_trait, C: 'async_trait,

Establishes a new connection to the database Read more
source§

fn load<'conn, 'query, T>( &'conn mut self, source: T ) -> <C as AsyncConnection>::LoadFuture<'conn, 'query>
where T: AsQuery + 'query, <T as AsQuery>::Query: QueryFragment<<C as AsyncConnection>::Backend> + QueryId + 'query,

source§

fn execute_returning_count<'conn, 'query, T>( &'conn mut self, source: T ) -> <C as AsyncConnection>::ExecuteFuture<'conn, 'query>
where T: QueryFragment<<C as AsyncConnection>::Backend> + QueryId + 'query,

source§

fn transaction_state( &mut self ) -> &mut <<C as AsyncConnection>::TransactionManager as TransactionManager<C>>::TransactionStateData

source§

fn begin_test_transaction<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, C: 'async_trait,

Creates a transaction that will never be committed. This is useful for tests. Panics if called while inside of a transaction or if called with a connection containing a broken transaction
source§

fn transaction<'a, 'life0, 'async_trait, R, E, F>( &'life0 mut self, callback: F ) -> Pin<Box<dyn Future<Output = Result<R, E>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, F: for<'r> FnOnce(&'r mut Self) -> Pin<Box<dyn ScopedFuture<'a, 'r, PhantomData<&'r &'a ()>, Output = Result<R, E>> + Send + 'r>> + Send + 'a + 'async_trait, E: From<Error> + Send + 'a + 'async_trait, R: Send + 'a + 'async_trait, Self: 'async_trait,

Executes the given function inside of a database transaction Read more
source§

fn test_transaction<'a, 'async_trait, R, E, F>( &'a mut self, f: F ) -> Pin<Box<dyn Future<Output = R> + Send + 'async_trait>>
where 'a: 'async_trait, F: for<'r> FnOnce(&'r mut Self) -> Pin<Box<dyn ScopedFuture<'a, 'r, PhantomData<&'r &'a ()>, Output = Result<R, E>> + Send + 'r>> + Send + 'a + 'async_trait, E: Debug + Send + 'a + 'async_trait, R: Send + 'a + 'async_trait, Self: 'a + 'async_trait,

Executes the given function inside a transaction, but does not commit it. Panics if the given function returns an error. 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
§

impl<T> Commands for T
where T: ConnectionLike,

§

fn get<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Get the value of a key. If key is a vec this becomes an MGET.
§

fn mget<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Get values of keys
§

fn keys<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Gets all keys matching pattern
§

fn set<'a, K, V, RV>(&mut self, key: K, value: V) -> Result<RV, RedisError>
where K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

Set the string value of a key.
§

fn set_options<'a, K, V, RV>( &mut self, key: K, value: V, options: SetOptions ) -> Result<RV, RedisError>
where K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

Set the string value of a key with options.
§

fn set_multiple<'a, K, V, RV>( &mut self, items: &'a [(K, V)] ) -> Result<RV, RedisError>
where K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

👎Deprecated since 0.22.4: Renamed to mset() to reflect Redis name
Sets multiple keys to their values.
§

fn mset<'a, K, V, RV>(&mut self, items: &'a [(K, V)]) -> Result<RV, RedisError>
where K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

Sets multiple keys to their values.
§

fn set_ex<'a, K, V, RV>( &mut self, key: K, value: V, seconds: usize ) -> Result<RV, RedisError>
where K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

Set the value and expiration of a key.
§

fn pset_ex<'a, K, V, RV>( &mut self, key: K, value: V, milliseconds: usize ) -> Result<RV, RedisError>
where K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

Set the value and expiration in milliseconds of a key.
§

fn set_nx<'a, K, V, RV>(&mut self, key: K, value: V) -> Result<RV, RedisError>
where K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

Set the value of a key, only if the key does not exist
§

fn mset_nx<'a, K, V, RV>( &mut self, items: &'a [(K, V)] ) -> Result<RV, RedisError>
where K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

Sets multiple keys to their values failing if at least one already exists.
§

fn getset<'a, K, V, RV>(&mut self, key: K, value: V) -> Result<RV, RedisError>
where K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

Set the string value of a key and return its old value.
§

fn getrange<'a, K, RV>( &mut self, key: K, from: isize, to: isize ) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Get a range of bytes/substring from the value of a key. Negative values provide an offset from the end of the value.
§

fn setrange<'a, K, V, RV>( &mut self, key: K, offset: isize, value: V ) -> Result<RV, RedisError>
where K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

Overwrite the part of the value stored in key at the specified offset.
§

fn del<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Delete one or more keys.
§

fn exists<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Determine if a key exists.
§

fn key_type<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Determine the type of a key.
§

fn expire<'a, K, RV>( &mut self, key: K, seconds: usize ) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Set a key’s time to live in seconds.
§

fn expire_at<'a, K, RV>(&mut self, key: K, ts: usize) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Set the expiration for a key as a UNIX timestamp.
§

fn pexpire<'a, K, RV>(&mut self, key: K, ms: usize) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Set a key’s time to live in milliseconds.
§

fn pexpire_at<'a, K, RV>(&mut self, key: K, ts: usize) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Set the expiration for a key as a UNIX timestamp in milliseconds.
§

fn persist<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Remove the expiration from a key.
§

fn ttl<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Get the expiration time of a key.
§

fn pttl<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Get the expiration time of a key in milliseconds.
§

fn get_ex<'a, K, RV>( &mut self, key: K, expire_at: Expiry ) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Get the value of a key and set expiration
§

fn get_del<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Get the value of a key and delete it
§

fn rename<'a, K, N, RV>(&mut self, key: K, new_key: N) -> Result<RV, RedisError>
where K: ToRedisArgs, N: ToRedisArgs, RV: FromRedisValue,

Rename a key.
§

fn rename_nx<'a, K, N, RV>( &mut self, key: K, new_key: N ) -> Result<RV, RedisError>
where K: ToRedisArgs, N: ToRedisArgs, RV: FromRedisValue,

Rename a key, only if the new key does not exist.
Unlink one or more keys.
§

fn append<'a, K, V, RV>(&mut self, key: K, value: V) -> Result<RV, RedisError>
where K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

Append a value to a key.
§

fn incr<'a, K, V, RV>(&mut self, key: K, delta: V) -> Result<RV, RedisError>
where K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

Increment the numeric value of a key by the given amount. This issues a INCRBY or INCRBYFLOAT depending on the type.
§

fn decr<'a, K, V, RV>(&mut self, key: K, delta: V) -> Result<RV, RedisError>
where K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

Decrement the numeric value of a key by the given amount.
§

fn setbit<'a, K, RV>( &mut self, key: K, offset: usize, value: bool ) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

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

fn getbit<'a, K, RV>(&mut self, key: K, offset: usize) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

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

fn bitcount<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Count set bits in a string.
§

fn bitcount_range<'a, K, RV>( &mut self, key: K, start: usize, end: usize ) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Count set bits in a string in a range.
§

fn bit_and<'a, D, S, RV>( &mut self, dstkey: D, srckeys: S ) -> Result<RV, RedisError>
where D: ToRedisArgs, S: ToRedisArgs, RV: FromRedisValue,

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

fn bit_or<'a, D, S, RV>( &mut self, dstkey: D, srckeys: S ) -> Result<RV, RedisError>
where D: ToRedisArgs, S: ToRedisArgs, RV: FromRedisValue,

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

fn bit_xor<'a, D, S, RV>( &mut self, dstkey: D, srckeys: S ) -> Result<RV, RedisError>
where D: ToRedisArgs, S: ToRedisArgs, RV: FromRedisValue,

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

fn bit_not<'a, D, S, RV>( &mut self, dstkey: D, srckey: S ) -> Result<RV, RedisError>
where D: ToRedisArgs, S: ToRedisArgs, RV: FromRedisValue,

Perform a bitwise NOT of the key (containing string values) and store the result in the destination key.
§

fn strlen<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Get the length of the value stored in a key.
§

fn hget<'a, K, F, RV>(&mut self, key: K, field: F) -> Result<RV, RedisError>
where K: ToRedisArgs, F: ToRedisArgs, RV: FromRedisValue,

Gets a single (or multiple) fields from a hash.
§

fn hdel<'a, K, F, RV>(&mut self, key: K, field: F) -> Result<RV, RedisError>
where K: ToRedisArgs, F: ToRedisArgs, RV: FromRedisValue,

Deletes a single (or multiple) fields from a hash.
§

fn hset<'a, K, F, V, RV>( &mut self, key: K, field: F, value: V ) -> Result<RV, RedisError>
where K: ToRedisArgs, F: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

Sets a single field in a hash.
§

fn hset_nx<'a, K, F, V, RV>( &mut self, key: K, field: F, value: V ) -> Result<RV, RedisError>
where K: ToRedisArgs, F: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

Sets a single field in a hash if it does not exist.
§

fn hset_multiple<'a, K, F, V, RV>( &mut self, key: K, items: &'a [(F, V)] ) -> Result<RV, RedisError>
where K: ToRedisArgs, F: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

Sets a multiple fields in a hash.
§

fn hincr<'a, K, F, D, RV>( &mut self, key: K, field: F, delta: D ) -> Result<RV, RedisError>
where K: ToRedisArgs, F: ToRedisArgs, D: ToRedisArgs, RV: FromRedisValue,

Increments a value.
§

fn hexists<'a, K, F, RV>(&mut self, key: K, field: F) -> Result<RV, RedisError>
where K: ToRedisArgs, F: ToRedisArgs, RV: FromRedisValue,

Checks if a field in a hash exists.
§

fn hkeys<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Gets all the keys in a hash.
§

fn hvals<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Gets all the values in a hash.
§

fn hgetall<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Gets all the fields and values in a hash.
§

fn hlen<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Gets the length of a hash.
§

fn blmove<'a, S, D, RV>( &mut self, srckey: S, dstkey: D, src_dir: Direction, dst_dir: Direction, timeout: usize ) -> Result<RV, RedisError>
where S: ToRedisArgs, D: ToRedisArgs, RV: FromRedisValue,

Pop an element from a list, push it to another list and return it; or block until one is available
§

fn blmpop<'a, K, RV>( &mut self, timeout: usize, numkeys: usize, key: K, dir: Direction, count: usize ) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Pops count elements from the first non-empty list key from the list of provided key names; or blocks until one is available.
§

fn blpop<'a, K, RV>(&mut self, key: K, timeout: usize) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Remove and get the first element in a list, or block until one is available.
§

fn brpop<'a, K, RV>(&mut self, key: K, timeout: usize) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Remove and get the last element in a list, or block until one is available.
§

fn brpoplpush<'a, S, D, RV>( &mut self, srckey: S, dstkey: D, timeout: usize ) -> Result<RV, RedisError>
where S: ToRedisArgs, D: ToRedisArgs, RV: FromRedisValue,

Pop a value from a list, push it to another list and return it; or block until one is available.
§

fn lindex<'a, K, RV>(&mut self, key: K, index: isize) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Get an element from a list by its index.
§

fn linsert_before<'a, K, P, V, RV>( &mut self, key: K, pivot: P, value: V ) -> Result<RV, RedisError>
where K: ToRedisArgs, P: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

Insert an element before another element in a list.
§

fn linsert_after<'a, K, P, V, RV>( &mut self, key: K, pivot: P, value: V ) -> Result<RV, RedisError>
where K: ToRedisArgs, P: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

Insert an element after another element in a list.
§

fn llen<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Returns the length of the list stored at key.
§

fn lmove<'a, S, D, RV>( &mut self, srckey: S, dstkey: D, src_dir: Direction, dst_dir: Direction ) -> Result<RV, RedisError>
where S: ToRedisArgs, D: ToRedisArgs, RV: FromRedisValue,

Pop an element a list, push it to another list and return it
§

fn lmpop<'a, K, RV>( &mut self, numkeys: usize, key: K, dir: Direction, count: usize ) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Pops count elements from the first non-empty list key from the list of provided key names.
§

fn lpop<'a, K, RV>( &mut self, key: K, count: Option<NonZero<usize>> ) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Removes and returns the up to count first elements of the list stored at key. Read more
§

fn lpos<'a, K, V, RV>( &mut self, key: K, value: V, options: LposOptions ) -> Result<RV, RedisError>
where K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

Returns the index of the first matching value of the list stored at key.
§

fn lpush<'a, K, V, RV>(&mut self, key: K, value: V) -> Result<RV, RedisError>
where K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

Insert all the specified values at the head of the list stored at key.
§

fn lpush_exists<'a, K, V, RV>( &mut self, key: K, value: V ) -> Result<RV, RedisError>
where K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

Inserts a value at the head of the list stored at key, only if key already exists and holds a list.
§

fn lrange<'a, K, RV>( &mut self, key: K, start: isize, stop: isize ) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Returns the specified elements of the list stored at key.
§

fn lrem<'a, K, V, RV>( &mut self, key: K, count: isize, value: V ) -> Result<RV, RedisError>
where K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

Removes the first count occurrences of elements equal to value from the list stored at key.
§

fn ltrim<'a, K, RV>( &mut self, key: K, start: isize, stop: isize ) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

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

fn lset<'a, K, V, RV>( &mut self, key: K, index: isize, value: V ) -> Result<RV, RedisError>
where K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

Sets the list element at index to value
§

fn rpop<'a, K, RV>( &mut self, key: K, count: Option<NonZero<usize>> ) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Removes and returns the up to count last elements of the list stored at key Read more
§

fn rpoplpush<'a, K, D, RV>( &mut self, key: K, dstkey: D ) -> Result<RV, RedisError>
where K: ToRedisArgs, D: ToRedisArgs, RV: FromRedisValue,

Pop a value from a list, push it to another list and return it.
§

fn rpush<'a, K, V, RV>(&mut self, key: K, value: V) -> Result<RV, RedisError>
where K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

Insert all the specified values at the tail of the list stored at key.
§

fn rpush_exists<'a, K, V, RV>( &mut self, key: K, value: V ) -> Result<RV, RedisError>
where K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue,

Inserts value at the tail of the list stored at key, only if key already exists and holds a list.
§

fn sadd<'a, K, M, RV>(&mut self, key: K, member: M) -> Result<RV, RedisError>
where K: ToRedisArgs, M: ToRedisArgs, RV: FromRedisValue,

Add one or more members to a set.
§

fn scard<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Get the number of members in a set.
§

fn sdiff<'a, K, RV>(&mut self, keys: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Subtract multiple sets.
§

fn sdiffstore<'a, D, K, RV>( &mut self, dstkey: D, keys: K ) -> Result<RV, RedisError>
where D: ToRedisArgs, K: ToRedisArgs, RV: FromRedisValue,

Subtract multiple sets and store the resulting set in a key.
§

fn sinter<'a, K, RV>(&mut self, keys: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Intersect multiple sets.
§

fn sinterstore<'a, D, K, RV>( &mut self, dstkey: D, keys: K ) -> Result<RV, RedisError>
where D: ToRedisArgs, K: ToRedisArgs, RV: FromRedisValue,

Intersect multiple sets and store the resulting set in a key.
§

fn sismember<'a, K, M, RV>( &mut self, key: K, member: M ) -> Result<RV, RedisError>
where K: ToRedisArgs, M: ToRedisArgs, RV: FromRedisValue,

Determine if a given value is a member of a set.
§

fn smembers<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Get all the members in a set.
§

fn smove<'a, S, D, M, RV>( &mut self, srckey: S, dstkey: D, member: M ) -> Result<RV, RedisError>
where S: ToRedisArgs, D: ToRedisArgs, M: ToRedisArgs, RV: FromRedisValue,

Move a member from one set to another.
§

fn spop<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Remove and return a random member from a set.
§

fn srandmember<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Get one random member from a set.
§

fn srandmember_multiple<'a, K, RV>( &mut self, key: K, count: usize ) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Get multiple random members from a set.
§

fn srem<'a, K, M, RV>(&mut self, key: K, member: M) -> Result<RV, RedisError>
where K: ToRedisArgs, M: ToRedisArgs, RV: FromRedisValue,

Remove one or more members from a set.
§

fn sunion<'a, K, RV>(&mut self, keys: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Add multiple sets.
§

fn sunionstore<'a, D, K, RV>( &mut self, dstkey: D, keys: K ) -> Result<RV, RedisError>
where D: ToRedisArgs, K: ToRedisArgs, RV: FromRedisValue,

Add multiple sets and store the resulting set in a key.
§

fn zadd<'a, K, S, M, RV>( &mut self, key: K, member: M, score: S ) -> Result<RV, RedisError>
where K: ToRedisArgs, S: ToRedisArgs, M: ToRedisArgs, RV: FromRedisValue,

Add one member to a sorted set, or update its score if it already exists.
§

fn zadd_multiple<'a, K, S, M, RV>( &mut self, key: K, items: &'a [(S, M)] ) -> Result<RV, RedisError>
where K: ToRedisArgs, S: ToRedisArgs, M: ToRedisArgs, RV: FromRedisValue,

Add multiple members to a sorted set, or update its score if it already exists.
§

fn zcard<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Get the number of members in a sorted set.
§

fn zcount<'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM ) -> Result<RV, RedisError>
where K: ToRedisArgs, M: ToRedisArgs, MM: ToRedisArgs, RV: FromRedisValue,

Count the members in a sorted set with scores within the given values.
§

fn zincr<'a, K, M, D, RV>( &mut self, key: K, member: M, delta: D ) -> Result<RV, RedisError>
where K: ToRedisArgs, M: ToRedisArgs, D: ToRedisArgs, RV: FromRedisValue,

Increments the member in a sorted set at key by delta. If the member does not exist, it is added with delta as its score.
§

fn zinterstore<'a, D, K, RV>( &mut self, dstkey: D, keys: &'a [K] ) -> Result<RV, RedisError>
where D: ToRedisArgs, K: ToRedisArgs, RV: FromRedisValue,

Intersect multiple sorted sets and store the resulting sorted set in a new key using SUM as aggregation function.
§

fn zinterstore_min<'a, D, K, RV>( &mut self, dstkey: D, keys: &'a [K] ) -> Result<RV, RedisError>
where D: ToRedisArgs, K: ToRedisArgs, RV: FromRedisValue,

Intersect multiple sorted sets and store the resulting sorted set in a new key using MIN as aggregation function.
§

fn zinterstore_max<'a, D, K, RV>( &mut self, dstkey: D, keys: &'a [K] ) -> Result<RV, RedisError>
where D: ToRedisArgs, K: ToRedisArgs, RV: FromRedisValue,

Intersect multiple sorted sets and store the resulting sorted set in a new key using MAX as aggregation function.
§

fn zinterstore_weights<'a, D, K, W, RV>( &mut self, dstkey: D, keys: &'a [(K, W)] ) -> Result<RV, RedisError>
where D: ToRedisArgs, K: ToRedisArgs, W: ToRedisArgs, RV: FromRedisValue,

[Commands::zinterstore], but with the ability to specify a multiplication factor for each sorted set by pairing one with each key in a tuple.
§

fn zinterstore_min_weights<'a, D, K, W, RV>( &mut self, dstkey: D, keys: &'a [(K, W)] ) -> Result<RV, RedisError>
where D: ToRedisArgs, K: ToRedisArgs, W: ToRedisArgs, RV: FromRedisValue,

[Commands::zinterstore_min], but with the ability to specify a multiplication factor for each sorted set by pairing one with each key in a tuple.
§

fn zinterstore_max_weights<'a, D, K, W, RV>( &mut self, dstkey: D, keys: &'a [(K, W)] ) -> Result<RV, RedisError>
where D: ToRedisArgs, K: ToRedisArgs, W: ToRedisArgs, RV: FromRedisValue,

[Commands::zinterstore_max], but with the ability to specify a multiplication factor for each sorted set by pairing one with each key in a tuple.
§

fn zlexcount<'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM ) -> Result<RV, RedisError>
where K: ToRedisArgs, M: ToRedisArgs, MM: ToRedisArgs, RV: FromRedisValue,

Count the number of members in a sorted set between a given lexicographical range.
§

fn zpopmax<'a, K, RV>(&mut self, key: K, count: isize) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Removes and returns up to count members with the highest scores in a sorted set
§

fn zpopmin<'a, K, RV>(&mut self, key: K, count: isize) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Removes and returns up to count members with the lowest scores in a sorted set
§

fn zmpop_max<'a, K, RV>( &mut self, keys: &'a [K], count: isize ) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Removes and returns up to count members with the highest scores, from the first non-empty sorted set in the provided list of key names.
§

fn zmpop_min<'a, K, RV>( &mut self, keys: &'a [K], count: isize ) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Removes and returns up to count members with the lowest scores, from the first non-empty sorted set in the provided list of key names.
§

fn zrandmember<'a, K, RV>( &mut self, key: K, count: Option<isize> ) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Return up to count random members in a sorted set (or 1 if count == None)
§

fn zrandmember_withscores<'a, K, RV>( &mut self, key: K, count: isize ) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Return up to count random members in a sorted set with scores
§

fn zrange<'a, K, RV>( &mut self, key: K, start: isize, stop: isize ) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Return a range of members in a sorted set, by index
§

fn zrange_withscores<'a, K, RV>( &mut self, key: K, start: isize, stop: isize ) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Return a range of members in a sorted set, by index with scores.
§

fn zrangebylex<'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM ) -> Result<RV, RedisError>
where K: ToRedisArgs, M: ToRedisArgs, MM: ToRedisArgs, RV: FromRedisValue,

Return a range of members in a sorted set, by lexicographical range.
§

fn zrangebylex_limit<'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM, offset: isize, count: isize ) -> Result<RV, RedisError>
where K: ToRedisArgs, M: ToRedisArgs, MM: ToRedisArgs, RV: FromRedisValue,

Return a range of members in a sorted set, by lexicographical range with offset and limit.
§

fn zrevrangebylex<'a, K, MM, M, RV>( &mut self, key: K, max: MM, min: M ) -> Result<RV, RedisError>
where K: ToRedisArgs, MM: ToRedisArgs, M: ToRedisArgs, RV: FromRedisValue,

Return a range of members in a sorted set, by lexicographical range.
§

fn zrevrangebylex_limit<'a, K, MM, M, RV>( &mut self, key: K, max: MM, min: M, offset: isize, count: isize ) -> Result<RV, RedisError>
where K: ToRedisArgs, MM: ToRedisArgs, M: ToRedisArgs, RV: FromRedisValue,

Return a range of members in a sorted set, by lexicographical range with offset and limit.
§

fn zrangebyscore<'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM ) -> Result<RV, RedisError>
where K: ToRedisArgs, M: ToRedisArgs, MM: ToRedisArgs, RV: FromRedisValue,

Return a range of members in a sorted set, by score.
§

fn zrangebyscore_withscores<'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM ) -> Result<RV, RedisError>
where K: ToRedisArgs, M: ToRedisArgs, MM: ToRedisArgs, RV: FromRedisValue,

Return a range of members in a sorted set, by score with scores.
§

fn zrangebyscore_limit<'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM, offset: isize, count: isize ) -> Result<RV, RedisError>
where K: ToRedisArgs, M: ToRedisArgs, MM: ToRedisArgs, RV: FromRedisValue,

Return a range of members in a sorted set, by score with limit.
§

fn zrangebyscore_limit_withscores<'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM, offset: isize, count: isize ) -> Result<RV, RedisError>
where K: ToRedisArgs, M: ToRedisArgs, MM: ToRedisArgs, RV: FromRedisValue,

Return a range of members in a sorted set, by score with limit with scores.
§

fn zrank<'a, K, M, RV>(&mut self, key: K, member: M) -> Result<RV, RedisError>
where K: ToRedisArgs, M: ToRedisArgs, RV: FromRedisValue,

Determine the index of a member in a sorted set.
§

fn zrem<'a, K, M, RV>(&mut self, key: K, members: M) -> Result<RV, RedisError>
where K: ToRedisArgs, M: ToRedisArgs, RV: FromRedisValue,

Remove one or more members from a sorted set.
§

fn zrembylex<'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM ) -> Result<RV, RedisError>
where K: ToRedisArgs, M: ToRedisArgs, MM: ToRedisArgs, RV: FromRedisValue,

Remove all members in a sorted set between the given lexicographical range.
§

fn zremrangebyrank<'a, K, RV>( &mut self, key: K, start: isize, stop: isize ) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Remove all members in a sorted set within the given indexes.
§

fn zrembyscore<'a, K, M, MM, RV>( &mut self, key: K, min: M, max: MM ) -> Result<RV, RedisError>
where K: ToRedisArgs, M: ToRedisArgs, MM: ToRedisArgs, RV: FromRedisValue,

Remove all members in a sorted set within the given scores.
§

fn zrevrange<'a, K, RV>( &mut self, key: K, start: isize, stop: isize ) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Return a range of members in a sorted set, by index, with scores ordered from high to low.
§

fn zrevrange_withscores<'a, K, RV>( &mut self, key: K, start: isize, stop: isize ) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Return a range of members in a sorted set, by index, with scores ordered from high to low.
§

fn zrevrangebyscore<'a, K, MM, M, RV>( &mut self, key: K, max: MM, min: M ) -> Result<RV, RedisError>
where K: ToRedisArgs, MM: ToRedisArgs, M: ToRedisArgs, RV: FromRedisValue,

Return a range of members in a sorted set, by score.
§

fn zrevrangebyscore_withscores<'a, K, MM, M, RV>( &mut self, key: K, max: MM, min: M ) -> Result<RV, RedisError>
where K: ToRedisArgs, MM: ToRedisArgs, M: ToRedisArgs, RV: FromRedisValue,

Return a range of members in a sorted set, by score with scores.
§

fn zrevrangebyscore_limit<'a, K, MM, M, RV>( &mut self, key: K, max: MM, min: M, offset: isize, count: isize ) -> Result<RV, RedisError>
where K: ToRedisArgs, MM: ToRedisArgs, M: ToRedisArgs, RV: FromRedisValue,

Return a range of members in a sorted set, by score with limit.
§

fn zrevrangebyscore_limit_withscores<'a, K, MM, M, RV>( &mut self, key: K, max: MM, min: M, offset: isize, count: isize ) -> Result<RV, RedisError>
where K: ToRedisArgs, MM: ToRedisArgs, M: ToRedisArgs, RV: FromRedisValue,

Return a range of members in a sorted set, by score with limit with scores.
§

fn zrevrank<'a, K, M, RV>( &mut self, key: K, member: M ) -> Result<RV, RedisError>
where K: ToRedisArgs, M: ToRedisArgs, RV: FromRedisValue,

Determine the index of a member in a sorted set, with scores ordered from high to low.
§

fn zscore<'a, K, M, RV>(&mut self, key: K, member: M) -> Result<RV, RedisError>
where K: ToRedisArgs, M: ToRedisArgs, RV: FromRedisValue,

Get the score associated with the given member in a sorted set.
§

fn zscore_multiple<'a, K, M, RV>( &mut self, key: K, members: &'a [M] ) -> Result<RV, RedisError>
where K: ToRedisArgs, M: ToRedisArgs, RV: FromRedisValue,

Get the scores associated with multiple members in a sorted set.
§

fn zunionstore<'a, D, K, RV>( &mut self, dstkey: D, keys: &'a [K] ) -> Result<RV, RedisError>
where D: ToRedisArgs, K: ToRedisArgs, RV: FromRedisValue,

Unions multiple sorted sets and store the resulting sorted set in a new key using SUM as aggregation function.
§

fn zunionstore_min<'a, D, K, RV>( &mut self, dstkey: D, keys: &'a [K] ) -> Result<RV, RedisError>
where D: ToRedisArgs, K: ToRedisArgs, RV: FromRedisValue,

Unions multiple sorted sets and store the resulting sorted set in a new key using MIN as aggregation function.
§

fn zunionstore_max<'a, D, K, RV>( &mut self, dstkey: D, keys: &'a [K] ) -> Result<RV, RedisError>
where D: ToRedisArgs, K: ToRedisArgs, RV: FromRedisValue,

Unions multiple sorted sets and store the resulting sorted set in a new key using MAX as aggregation function.
§

fn zunionstore_weights<'a, D, K, W, RV>( &mut self, dstkey: D, keys: &'a [(K, W)] ) -> Result<RV, RedisError>
where D: ToRedisArgs, K: ToRedisArgs, W: ToRedisArgs, RV: FromRedisValue,

[Commands::zunionstore], but with the ability to specify a multiplication factor for each sorted set by pairing one with each key in a tuple.
§

fn zunionstore_min_weights<'a, D, K, W, RV>( &mut self, dstkey: D, keys: &'a [(K, W)] ) -> Result<RV, RedisError>
where D: ToRedisArgs, K: ToRedisArgs, W: ToRedisArgs, RV: FromRedisValue,

[Commands::zunionstore_min], but with the ability to specify a multiplication factor for each sorted set by pairing one with each key in a tuple.
§

fn zunionstore_max_weights<'a, D, K, W, RV>( &mut self, dstkey: D, keys: &'a [(K, W)] ) -> Result<RV, RedisError>
where D: ToRedisArgs, K: ToRedisArgs, W: ToRedisArgs, RV: FromRedisValue,

[Commands::zunionstore_max], but with the ability to specify a multiplication factor for each sorted set by pairing one with each key in a tuple.
§

fn pfadd<'a, K, E, RV>(&mut self, key: K, element: E) -> Result<RV, RedisError>
where K: ToRedisArgs, E: ToRedisArgs, RV: FromRedisValue,

Adds the specified elements to the specified HyperLogLog.
§

fn pfcount<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

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

fn pfmerge<'a, D, S, RV>( &mut self, dstkey: D, srckeys: S ) -> Result<RV, RedisError>
where D: ToRedisArgs, S: ToRedisArgs, RV: FromRedisValue,

Merge N different HyperLogLogs into a single one.
§

fn publish<'a, K, E, RV>( &mut self, channel: K, message: E ) -> Result<RV, RedisError>
where K: ToRedisArgs, E: ToRedisArgs, RV: FromRedisValue,

Posts a message to the given channel.
§

fn object_encoding<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Returns the encoding of a key.
§

fn object_idletime<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Returns the time in seconds since the last access of a key.
§

fn object_freq<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Returns the logarithmic access frequency counter of a key.
§

fn object_refcount<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Returns the reference count of a key.
§

fn xrevrange_all<'a, K, RV>(&mut self, key: K) -> Result<RV, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

This is the reverse version of xrange_all. The same rules apply for start and end here. Read more
§

fn scan<RV>(&mut self) -> Result<Iter<'_, RV>, RedisError>
where RV: FromRedisValue,

Incrementally iterate the keys space.
§

fn scan_match<P, RV>(&mut self, pattern: P) -> Result<Iter<'_, RV>, RedisError>
where P: ToRedisArgs, RV: FromRedisValue,

Incrementally iterate the keys space for keys matching a pattern.
§

fn hscan<K, RV>(&mut self, key: K) -> Result<Iter<'_, RV>, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Incrementally iterate hash fields and associated values.
§

fn hscan_match<K, P, RV>( &mut self, key: K, pattern: P ) -> Result<Iter<'_, RV>, RedisError>
where K: ToRedisArgs, P: ToRedisArgs, RV: FromRedisValue,

Incrementally iterate hash fields and associated values for field names matching a pattern.
§

fn sscan<K, RV>(&mut self, key: K) -> Result<Iter<'_, RV>, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Incrementally iterate set elements.
§

fn sscan_match<K, P, RV>( &mut self, key: K, pattern: P ) -> Result<Iter<'_, RV>, RedisError>
where K: ToRedisArgs, P: ToRedisArgs, RV: FromRedisValue,

Incrementally iterate set elements for elements matching a pattern.
§

fn zscan<K, RV>(&mut self, key: K) -> Result<Iter<'_, RV>, RedisError>
where K: ToRedisArgs, RV: FromRedisValue,

Incrementally iterate sorted set elements.
§

fn zscan_match<K, P, RV>( &mut self, key: K, pattern: P ) -> Result<Iter<'_, RV>, RedisError>
where K: ToRedisArgs, P: ToRedisArgs, RV: FromRedisValue,

Incrementally iterate sorted set elements for elements matching a pattern.
§

impl<C, T> ConnectionLike for T
where C: ConnectionLike, T: DerefMut<Target = C>,

§

fn req_packed_command(&mut self, cmd: &[u8]) -> Result<Value, RedisError>

Sends an already encoded (packed) command into the TCP socket and reads the single response from it.
§

fn req_packed_commands( &mut self, cmd: &[u8], offset: usize, count: usize ) -> Result<Vec<Value>, RedisError>

Sends multiple already encoded (packed) command into the TCP socket and reads count responses from it. This is used to implement pipelining.
§

fn req_command(&mut self, cmd: &Cmd) -> Result<Value, RedisError>

Sends a Cmd into the TCP socket and reads a single response from it.
§

fn get_db(&self) -> i64

Returns the database this connection is bound to. Note that this information might be unreliable because it’s initially cached and also might be incorrect if the connection like object is not actually connected.
§

fn supports_pipelining(&self) -> bool

§

fn check_connection(&mut self) -> bool

Check that all connections it has are available (PING internally).
§

fn is_open(&self) -> bool

Returns the connection status. Read more
§

impl<T> Conv for T

§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
§

impl<Choices> CoproductSubsetter<CNil, HNil> for Choices

§

type Remainder = Choices

§

fn subset( self ) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>

Extract a subset of the possible types in a coproduct (or get the remaining possibilities) Read more
§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> IntoCollection<T> for T

§

fn into_collection<A>(self) -> SmallVec<A>
where A: Array<Item = T>,

Converts self into a collection.
§

fn mapped<U, F, A>(self, f: F) -> SmallVec<A>
where F: FnMut(T) -> U, A: Array<Item = U>,

source§

impl<T> IntoSql for T

source§

fn into_sql<T>(self) -> Self::Expression

Convert self to an expression for Diesel’s query builder. Read more
source§

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression

Convert &self to an expression for Diesel’s query builder. Read more
§

impl<T, U, I> LiftInto<U, I> for T
where U: LiftFrom<T, I>,

§

fn lift_into(self) -> U

Performs the indexed conversion.
§

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

§

fn fg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the foreground set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like red() and green(), which have the same functionality but are pithier.

§Example

Set foreground color to white using fg():

use yansi::{Paint, Color};

painted.fg(Color::White);

Set foreground color to white using white().

use yansi::Paint;

painted.white();
§

fn primary(&self) -> Painted<&T>

Returns self with the fg() set to [Color::Primary].

§Example
println!("{}", value.primary());
§

fn fixed(&self, color: u8) -> Painted<&T>

Returns self with the fg() set to [Color::Fixed].

§Example
println!("{}", value.fixed(color));
§

fn rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the fg() set to [Color::Rgb].

§Example
println!("{}", value.rgb(r, g, b));
§

fn black(&self) -> Painted<&T>

Returns self with the fg() set to [Color::Black].

§Example
println!("{}", value.black());
§

fn red(&self) -> Painted<&T>

Returns self with the fg() set to [Color::Red].

§Example
println!("{}", value.red());
§

fn green(&self) -> Painted<&T>

Returns self with the fg() set to [Color::Green].

§Example
println!("{}", value.green());
§

fn yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color::Yellow].

§Example
println!("{}", value.yellow());
§

fn blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color::Blue].

§Example
println!("{}", value.blue());
§

fn magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color::Magenta].

§Example
println!("{}", value.magenta());
§

fn cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color::Cyan].

§Example
println!("{}", value.cyan());
§

fn white(&self) -> Painted<&T>

Returns self with the fg() set to [Color::White].

§Example
println!("{}", value.white());
§

fn bright_black(&self) -> Painted<&T>

Returns self with the fg() set to [Color::BrightBlack].

§Example
println!("{}", value.bright_black());
§

fn bright_red(&self) -> Painted<&T>

Returns self with the fg() set to [Color::BrightRed].

§Example
println!("{}", value.bright_red());
§

fn bright_green(&self) -> Painted<&T>

Returns self with the fg() set to [Color::BrightGreen].

§Example
println!("{}", value.bright_green());
§

fn bright_yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color::BrightYellow].

§Example
println!("{}", value.bright_yellow());
§

fn bright_blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color::BrightBlue].

§Example
println!("{}", value.bright_blue());
§

fn bright_magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color::BrightMagenta].

§Example
println!("{}", value.bright_magenta());
§

fn bright_cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color::BrightCyan].

§Example
println!("{}", value.bright_cyan());
§

fn bright_white(&self) -> Painted<&T>

Returns self with the fg() set to [Color::BrightWhite].

§Example
println!("{}", value.bright_white());
§

fn bg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the background set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like on_red() and on_green(), which have the same functionality but are pithier.

§Example

Set background color to red using fg():

use yansi::{Paint, Color};

painted.bg(Color::Red);

Set background color to red using on_red().

use yansi::Paint;

painted.on_red();
§

fn on_primary(&self) -> Painted<&T>

Returns self with the bg() set to [Color::Primary].

§Example
println!("{}", value.on_primary());
§

fn on_fixed(&self, color: u8) -> Painted<&T>

Returns self with the bg() set to [Color::Fixed].

§Example
println!("{}", value.on_fixed(color));
§

fn on_rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the bg() set to [Color::Rgb].

§Example
println!("{}", value.on_rgb(r, g, b));
§

fn on_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color::Black].

§Example
println!("{}", value.on_black());
§

fn on_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color::Red].

§Example
println!("{}", value.on_red());
§

fn on_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color::Green].

§Example
println!("{}", value.on_green());
§

fn on_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color::Yellow].

§Example
println!("{}", value.on_yellow());
§

fn on_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color::Blue].

§Example
println!("{}", value.on_blue());
§

fn on_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color::Magenta].

§Example
println!("{}", value.on_magenta());
§

fn on_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color::Cyan].

§Example
println!("{}", value.on_cyan());
§

fn on_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color::White].

§Example
println!("{}", value.on_white());
§

fn on_bright_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color::BrightBlack].

§Example
println!("{}", value.on_bright_black());
§

fn on_bright_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color::BrightRed].

§Example
println!("{}", value.on_bright_red());
§

fn on_bright_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color::BrightGreen].

§Example
println!("{}", value.on_bright_green());
§

fn on_bright_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color::BrightYellow].

§Example
println!("{}", value.on_bright_yellow());
§

fn on_bright_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color::BrightBlue].

§Example
println!("{}", value.on_bright_blue());
§

fn on_bright_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color::BrightMagenta].

§Example
println!("{}", value.on_bright_magenta());
§

fn on_bright_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color::BrightCyan].

§Example
println!("{}", value.on_bright_cyan());
§

fn on_bright_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color::BrightWhite].

§Example
println!("{}", value.on_bright_white());
§

fn attr(&self, value: Attribute) -> Painted<&T>

Enables the styling [Attribute] value.

This method should be used rarely. Instead, prefer to use attribute-specific builder methods like bold() and underline(), which have the same functionality but are pithier.

§Example

Make text bold using attr():

use yansi::{Paint, Attribute};

painted.attr(Attribute::Bold);

Make text bold using using bold().

use yansi::Paint;

painted.bold();
§

fn bold(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute::Bold].

§Example
println!("{}", value.bold());
§

fn dim(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute::Dim].

§Example
println!("{}", value.dim());
§

fn italic(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute::Italic].

§Example
println!("{}", value.italic());
§

fn underline(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute::Underline].

§Example
println!("{}", value.underline());

Returns self with the attr() set to [Attribute::Blink].

§Example
println!("{}", value.blink());

Returns self with the attr() set to [Attribute::RapidBlink].

§Example
println!("{}", value.rapid_blink());
§

fn invert(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute::Invert].

§Example
println!("{}", value.invert());
§

fn conceal(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute::Conceal].

§Example
println!("{}", value.conceal());
§

fn strike(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute::Strike].

§Example
println!("{}", value.strike());
§

fn quirk(&self, value: Quirk) -> Painted<&T>

Enables the yansi [Quirk] value.

This method should be used rarely. Instead, prefer to use quirk-specific builder methods like mask() and wrap(), which have the same functionality but are pithier.

§Example

Enable wrapping using .quirk():

use yansi::{Paint, Quirk};

painted.quirk(Quirk::Wrap);

Enable wrapping using wrap().

use yansi::Paint;

painted.wrap();
§

fn mask(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk::Mask].

§Example
println!("{}", value.mask());
§

fn wrap(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk::Wrap].

§Example
println!("{}", value.wrap());
§

fn linger(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk::Linger].

§Example
println!("{}", value.linger());
§

fn clear(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk::Clear].

§Example
println!("{}", value.clear());
§

fn bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk::Bright].

§Example
println!("{}", value.bright());
§

fn on_bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk::OnBright].

§Example
println!("{}", value.on_bright());
§

fn whenever(&self, value: Condition) -> Painted<&T>

Conditionally enable styling based on whether the [Condition] value applies. Replaces any previous condition.

See the crate level docs for more details.

§Example

Enable styling painted only when both stdout and stderr are TTYs:

use yansi::{Paint, Condition};

painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);
§

fn new(self) -> Painted<Self>
where Self: Sized,

Create a new [Painted] with a default [Style]. Read more
§

fn paint<S>(&self, style: S) -> Painted<&Self>
where S: Into<Style>,

Apply a style wholesale to self. Any previous style is replaced. Read more
§

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

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, Conn> RunQueryDsl<Conn> for T

source§

fn execute<'conn, 'query>( self, conn: &'conn mut Conn ) -> <Conn as AsyncConnection>::ExecuteFuture<'conn, 'query>
where Conn: AsyncConnection + Send, Self: ExecuteDsl<Conn> + 'query,

Executes the given command, returning the number of rows affected. Read more
source§

fn load<'query, 'conn, U>( self, conn: &'conn mut Conn ) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>, fn(_: Self::Stream<'conn>) -> TryCollect<Self::Stream<'conn>, Vec<U>>>
where U: Send, Conn: AsyncConnection, Self: LoadQuery<'query, Conn, U> + 'query,

Executes the given query, returning a Vec with the returned rows. Read more
source§

fn load_stream<'conn, 'query, U>( self, conn: &'conn mut Conn ) -> Self::LoadFuture<'conn>
where Conn: AsyncConnection, U: 'conn, Self: LoadQuery<'query, Conn, U> + 'query,

Executes the given query, returning a [Stream] with the returned rows. Read more
source§

fn get_result<'query, 'conn, U>( self, conn: &'conn mut Conn ) -> AndThen<Self::LoadFuture<'conn>, Map<StreamFuture<Pin<Box<Self::Stream<'conn>>>>, fn(_: (Option<Result<U, Error>>, Pin<Box<Self::Stream<'conn>>>)) -> Result<U, Error>>, fn(_: Self::Stream<'conn>) -> Map<StreamFuture<Pin<Box<Self::Stream<'conn>>>>, fn(_: (Option<Result<U, Error>>, Pin<Box<Self::Stream<'conn>>>)) -> Result<U, Error>>>
where U: Send + 'conn, Conn: AsyncConnection, Self: LoadQuery<'query, Conn, U> + 'query,

Runs the command, and returns the affected row. Read more
source§

fn get_results<'query, 'conn, U>( self, conn: &'conn mut Conn ) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>, fn(_: Self::Stream<'conn>) -> TryCollect<Self::Stream<'conn>, Vec<U>>>
where U: Send, Conn: AsyncConnection, Self: LoadQuery<'query, Conn, U> + 'query,

Runs the command, returning an Vec with the affected rows. Read more
source§

fn first<'query, 'conn, U>( self, conn: &'conn mut Conn ) -> AndThen<<Self::Output as LoadQuery<'query, Conn, U>>::LoadFuture<'conn>, Map<StreamFuture<Pin<Box<<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>>>>, fn(_: (Option<Result<U, Error>>, Pin<Box<<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>>>)) -> Result<U, Error>>, fn(_: <Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>) -> Map<StreamFuture<Pin<Box<<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>>>>, fn(_: (Option<Result<U, Error>>, Pin<Box<<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>>>)) -> Result<U, Error>>>
where U: Send + 'conn, Conn: AsyncConnection, Self: LimitDsl, Self::Output: LoadQuery<'query, Conn, U> + Send + 'query,

Attempts to load a single record. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<Source> Sculptor<HNil, HNil> for Source

§

type Remainder = Source

§

fn sculpt(self) -> (HNil, <Source as Sculptor<HNil, HNil>>::Remainder)

Consumes the current HList and returns an HList with the requested shape. Read more
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
source§

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

§

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>,

§

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<Changes, Output, Conn> UpdateAndFetchResults<Changes, Output> for Conn
where Conn: DerefMut + Send, Changes: Identifiable + HasTable + Send, <Conn as Deref>::Target: UpdateAndFetchResults<Changes, Output>,

source§

fn update_and_fetch<'life0, 'async_trait>( &'life0 mut self, changeset: Changes ) -> Pin<Box<dyn Future<Output = Result<Output, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Changes: 'async_trait, Conn: 'async_trait,

See the traits documentation.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> Formattable for T
where T: Deref, <T as Deref>::Target: Formattable,

§

impl<T> Parsable for T
where T: Deref, <T as Deref>::Target: Parsable,