Struct tokio_postgres::error::DbError
source · [−]pub struct DbError { /* private fields */ }
Expand description
A Postgres error or notice.
Implementations
sourceimpl DbError
impl DbError
sourcepub fn severity(&self) -> &str
pub fn severity(&self) -> &str
The field contents are ERROR, FATAL, or PANIC (in an error message), or WARNING, NOTICE, DEBUG, INFO, or LOG (in a notice message), or a localized translation of one of these.
sourcepub fn parsed_severity(&self) -> Option<Severity>
pub fn parsed_severity(&self) -> Option<Severity>
A parsed, nonlocalized version of severity
. (PostgreSQL 9.6+)
sourcepub fn message(&self) -> &str
pub fn message(&self) -> &str
The primary human-readable error message.
This should be accurate but terse (typically one line).
sourcepub fn detail(&self) -> Option<&str>
pub fn detail(&self) -> Option<&str>
An optional secondary error message carrying more detail about the problem.
Might run to multiple lines.
sourcepub fn hint(&self) -> Option<&str>
pub fn hint(&self) -> Option<&str>
An optional suggestion what to do about the problem.
This is intended to differ from detail
in that it offers advice
(potentially inappropriate) rather than hard facts. Might run to
multiple lines.
sourcepub fn position(&self) -> Option<&ErrorPosition>
pub fn position(&self) -> Option<&ErrorPosition>
An optional error cursor position into either the original query string or an internally generated query.
sourcepub fn where_(&self) -> Option<&str>
pub fn where_(&self) -> Option<&str>
An indication of the context in which the error occurred.
Presently this includes a call stack traceback of active procedural language functions and internally-generated queries. The trace is one entry per line, most recent first.
sourcepub fn schema(&self) -> Option<&str>
pub fn schema(&self) -> Option<&str>
If the error was associated with a specific database object, the name of the schema containing that object, if any. (PostgreSQL 9.3+)
sourcepub fn table(&self) -> Option<&str>
pub fn table(&self) -> Option<&str>
If the error was associated with a specific table, the name of the table. (Refer to the schema name field for the name of the table’s schema.) (PostgreSQL 9.3+)
sourcepub fn column(&self) -> Option<&str>
pub fn column(&self) -> Option<&str>
If the error was associated with a specific table column, the name of the column.
(Refer to the schema and table name fields to identify the table.) (PostgreSQL 9.3+)
sourcepub fn datatype(&self) -> Option<&str>
pub fn datatype(&self) -> Option<&str>
If the error was associated with a specific data type, the name of the data type. (Refer to the schema name field for the name of the data type’s schema.) (PostgreSQL 9.3+)
sourcepub fn constraint(&self) -> Option<&str>
pub fn constraint(&self) -> Option<&str>
If the error was associated with a specific constraint, the name of the constraint.
Refer to fields listed above for the associated table or domain. (For this purpose, indexes are treated as constraints, even if they weren’t created with constraint syntax.) (PostgreSQL 9.3+)
sourcepub fn file(&self) -> Option<&str>
pub fn file(&self) -> Option<&str>
The file name of the source-code location where the error was reported.
Trait Implementations
sourceimpl Error for DbError
impl Error for DbError
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
impl Eq for DbError
impl StructuralEq for DbError
impl StructuralPartialEq for DbError
Auto Trait Implementations
impl RefUnwindSafe for DbError
impl Send for DbError
impl Sync for DbError
impl Unpin for DbError
impl UnwindSafe for DbError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more