Skip to main content

DatabaseErrorInformation

Trait DatabaseErrorInformation 

Source
pub trait DatabaseErrorInformation {
    // Required methods
    fn message(&self) -> &str;
    fn details(&self) -> Option<&str>;
    fn hint(&self) -> Option<&str>;
    fn table_name(&self) -> Option<&str>;
    fn column_name(&self) -> Option<&str>;
    fn constraint_name(&self) -> Option<&str>;
    fn statement_position(&self) -> Option<i32>;
}
Expand description

Information about an error that was returned by the database.

Required Methods§

Source

fn message(&self) -> &str

The primary human-readable error message. Typically one line.

Source

fn details(&self) -> Option<&str>

An optional secondary error message providing more details about the problem, if it was provided by the database. Might span multiple lines.

Source

fn hint(&self) -> Option<&str>

An optional suggestion of what to do about the problem, if one was provided by the database.

Source

fn table_name(&self) -> Option<&str>

The name of the table the error was associated with, if the error was associated with a specific table and the backend supports retrieving that information.

Currently this method will return None for all backends other than PostgreSQL.

Source

fn column_name(&self) -> Option<&str>

The name of the column the error was associated with, if the error was associated with a specific column and the backend supports retrieving that information.

Currently this method will return None for all backends other than PostgreSQL.

Source

fn constraint_name(&self) -> Option<&str>

The constraint that was violated if this error is a constraint violation and the backend supports retrieving that information.

Currently this method will return None for all backends other than PostgreSQL.

Source

fn statement_position(&self) -> Option<i32>

An optional integer indicating an error cursor position as an index into the original statement string.

Trait Implementations§

Source§

impl Debug for dyn DatabaseErrorInformation + Send + Sync

Source§

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

Formats the value using the given formatter. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl DatabaseErrorInformation for Infallible

Source§

impl DatabaseErrorInformation for String

Implementors§