pub enum PgError {
Pool(PoolError),
Postgres(Error),
Config(String),
Connection(String),
Query(String),
Deserialization(String),
TypeConversion(String),
Timeout(u64),
Internal(String),
}Expand description
Errors that can occur during PostgreSQL operations.
Variants§
Pool(PoolError)
Connection pool error.
Postgres(Error)
PostgreSQL error.
Config(String)
Configuration error.
Connection(String)
Connection error.
Query(String)
Query execution error.
Deserialization(String)
Row deserialization error.
TypeConversion(String)
Type conversion error.
Timeout(u64)
Timeout error.
Internal(String)
Internal error.
Implementations§
Source§impl PgError
impl PgError
Sourcepub fn connection(message: impl Into<String>) -> Self
pub fn connection(message: impl Into<String>) -> Self
Create a connection error.
Sourcepub fn deserialization(message: impl Into<String>) -> Self
pub fn deserialization(message: impl Into<String>) -> Self
Create a deserialization error.
Sourcepub fn type_conversion(message: impl Into<String>) -> Self
pub fn type_conversion(message: impl Into<String>) -> Self
Create a type conversion error.
Sourcepub fn is_connection_error(&self) -> bool
pub fn is_connection_error(&self) -> bool
Check if this is a connection error.
Sourcepub fn is_timeout(&self) -> bool
pub fn is_timeout(&self) -> bool
Check if this is a timeout error.
Trait Implementations§
Source§impl Error for PgError
impl Error for PgError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<PgError> for QueryError
impl From<PgError> for QueryError
Auto Trait Implementations§
impl Freeze for PgError
impl !RefUnwindSafe for PgError
impl Send for PgError
impl Sync for PgError
impl Unpin for PgError
impl !UnwindSafe for PgError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<E> IntoQueryError for E
impl<E> IntoQueryError for E
Source§fn into_query_error(self) -> QueryError
fn into_query_error(self) -> QueryError
Convert to a QueryError.