Enum reool::config::DefaultPoolCheckoutMode[][src]

pub enum DefaultPoolCheckoutMode {
    Immediately,
    Wait,
    WaitAtMost(Duration),
}
Expand description

Various options on retrieving a connection that can be applied if a user wants to use the pool defaults for retrieving a connection.

The default is to wait for 30ms.

This struct only slightly differs from CheckoutMode: It lacks the variant PoolDefault since that variant would make no sense as this enum describes the default behaviour of the pool.

This struct has the same behaviour as CheckoutMode regarding its From implementations.

The default is to wait for 30ms.

Variants

Immediately

Expect a connection to be returned immediately. If there is none available return an error immediately.

Wait

Wait until there is a connection.

Using this can be risky as connections are returned when dropped. If the pool has no idle connections left while none are returned a deadlock might occur. It is always safe to use this mode if only the RedisPool itself is used as a connection since it will immediately return the used connection after each operation.

WaitAtMost

Wait for at most the given Duration.

The amount of time waited will in the end not be really exact.

Tuple Fields of WaitAtMost

0: Duration

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.