Skip to main content

PoolError

Enum PoolError 

Source
pub enum PoolError {
    Config(String),
    Closed(String),
    Timeout(String),
    Exhausted(String),
    ConnectionCreate {
        message: String,
        source: Option<FactoryError>,
    },
    CircuitOpen {
        retry_after: f64,
    },
    InvalidRelease(String),
}
Expand description

Every error the pool raises. Mirrors the PoolError base type of the other languages; each variant corresponds to a sibling error class.

Variants§

§

Config(String)

Invalid pool / breaker / retry configuration (PoolConfigError).

§

Closed(String)

The pool has been closed; no more connections can be acquired (PoolClosedError).

§

Timeout(String)

No connection became available before the acquire deadline (PoolTimeoutError).

§

Exhausted(String)

The pool is full and the waiter queue is at max_waiters (PoolExhaustedError).

§

ConnectionCreate

The factory failed to create a connection after all retries (ConnectionCreateError). The original error is available via Error::source/PoolError::source_error.

Fields

§message: String

Human-readable message.

§source: Option<FactoryError>

The underlying factory error, if any.

§

CircuitOpen

The circuit breaker is rejecting calls to protect a failing backend (CircuitOpenError). retry_after is the approximate seconds until it probes again.

Fields

§retry_after: f64

Approximate seconds until the breaker probes again.

§

InvalidRelease(String)

An object that is not checked out from this pool was released — a double release? (InvalidReleaseError).

Implementations§

Source§

impl PoolError

Source

pub fn source_error(&self) -> Option<&(dyn Error + 'static)>

Returns the underlying factory error for a PoolError::ConnectionCreate, if present.

Trait Implementations§

Source§

impl Debug for PoolError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for PoolError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for PoolError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.