Enum reool::CheckoutMode[][src]

pub enum CheckoutMode {
    Immediately,
    Wait,
    PoolDefault,
    Until(Instant),
}

Various options on retrieving a connection

Special From implementations

  • Duration: Until with a deadline from now until the durations elapsed.
  • Instant: Until the given instant.

Variants

Immediately

Expect a connection to be returned immediately. If there is none available return an error immediately. In that case a CheckoutErrorKind::NoConnection will be returned

This mode will always try to get a connection

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.

PoolDefault

Use the default configured for the pool

Until(Instant)

Checkout before the given Instant is elapsed. If the given timeout is elapsed, no attempt to checkout a connection will be made. In that case a CheckoutErrorKind::CheckoutTimeout will be returned.

Implementations

impl CheckoutMode[src]

Trait Implementations

impl Clone for CheckoutMode[src]

impl Copy for CheckoutMode[src]

impl Debug for CheckoutMode[src]

impl Default for CheckoutMode[src]

impl Eq for CheckoutMode[src]

impl From<Duration> for CheckoutMode[src]

impl From<Immediately> for CheckoutMode[src]

impl From<Instant> for CheckoutMode[src]

impl From<Millis> for CheckoutMode[src]

impl From<PoolDefault> for CheckoutMode[src]

impl From<Seconds> for CheckoutMode[src]

impl From<Wait> for CheckoutMode[src]

impl PartialEq<CheckoutMode> for CheckoutMode[src]

impl StructuralEq for CheckoutMode[src]

impl StructuralPartialEq for CheckoutMode[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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