[−][src]Struct postgres::error::DbError
A Postgres error or notice.
Methods
impl DbError
[src]
pub fn severity(&self) -> &str
[src]
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.
pub fn parsed_severity(&self) -> Option<Severity>
[src]
A parsed, nonlocalized version of severity
. (PostgreSQL 9.6+)
pub fn code(&self) -> &SqlState
[src]
The SQLSTATE code for the error.
pub fn message(&self) -> &str
[src]
The primary human-readable error message.
This should be accurate but terse (typically one line).
pub fn detail(&self) -> Option<&str>
[src]
An optional secondary error message carrying more detail about the problem.
Might run to multiple lines.
pub fn hint(&self) -> Option<&str>
[src]
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.
pub fn position(&self) -> Option<&ErrorPosition>
[src]
An optional error cursor position into either the original query string or an internally generated query.
pub fn where_(&self) -> Option<&str>
[src]
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.
pub fn schema(&self) -> Option<&str>
[src]
If the error was associated with a specific database object, the name of the schema containing that object, if any. (PostgreSQL 9.3+)
pub fn table(&self) -> Option<&str>
[src]
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+)
pub fn column(&self) -> Option<&str>
[src]
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+)
pub fn datatype(&self) -> Option<&str>
[src]
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+)
pub fn constraint(&self) -> Option<&str>
[src]
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+)
pub fn file(&self) -> Option<&str>
[src]
The file name of the source-code location where the error was reported.
pub fn line(&self) -> Option<u32>
[src]
The line number of the source-code location where the error was reported.
pub fn routine(&self) -> Option<&str>
[src]
The name of the source-code routine reporting the error.
Trait Implementations
impl Clone for DbError
[src]
fn clone(&self) -> DbError
[src]
default fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<DbError> for DbError
[src]
impl Eq for DbError
[src]
impl Display for DbError
[src]
impl Error for DbError
[src]
default fn description(&self) -> &str
1.0.0[src]
This method is soft-deprecated. Read more
default fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
replaced by Error::source, which can support downcasting
The lower-level cause of this error, if any. Read more
default fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
The lower-level source of this error, if any. Read more
default fn type_id(&self) -> TypeId where
Self: 'static,
1.34.0[src]
Self: 'static,
Gets the TypeId
of self
impl Debug for DbError
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T> Same for T
type Output = T
Should always be Self