Struct sqlx_models_orm::PgDatabaseError
[−]pub struct PgDatabaseError(_);
Expand description
An error returned from the PostgreSQL database.
Implementations
impl PgDatabaseError
impl PgDatabaseError
pub fn severity(&self) -> PgSeverity
pub fn message(&self) -> &str
pub fn message(&self) -> &str
The primary human-readable error message. This should be accurate but terse (typically one line).
pub 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.
pub 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.
pub fn position(&self) -> Option<PgErrorPosition<'_>>
pub fn position(&self) -> Option<PgErrorPosition<'_>>
Indicates an error cursor position as an index into the original query string; or, a position into an internally generated query.
pub 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.
pub fn schema(&self) -> Option<&str>
pub fn schema(&self) -> Option<&str>
If this error is with a specific database object, the name of the schema containing that object, if any.
pub fn column(&self) -> Option<&str>
pub fn column(&self) -> Option<&str>
If the error is with a specific table column, the name of the column.
pub fn data_type(&self) -> Option<&str>
pub fn data_type(&self) -> Option<&str>
If the error is with a specific data type, the name of the data type.
pub fn constraint(&self) -> Option<&str>
pub fn constraint(&self) -> Option<&str>
If the error is with a specific constraint, the name of the constraint. For this purpose, indexes are constraints, even if they weren’t created with constraint syntax.
pub fn file(&self) -> Option<&str>
pub fn file(&self) -> Option<&str>
The file name of the source-code location where this error was reported.
Trait Implementations
impl DatabaseError for PgDatabaseError
impl DatabaseError for PgDatabaseError
fn constraint(&self) -> Option<&str>
fn constraint(&self) -> Option<&str>
Returns the name of the constraint that triggered the error, if applicable. If the error was caused by a conflict of a unique index, this will be the index name. Read more
impl Debug for PgDatabaseError
impl Debug for PgDatabaseError
impl Display for PgDatabaseError
impl Display for PgDatabaseError
impl Error for PgDatabaseError
impl Error for PgDatabaseError
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()
Auto Trait Implementations
impl RefUnwindSafe for PgDatabaseError
impl Send for PgDatabaseError
impl Sync for PgDatabaseError
impl Unpin for PgDatabaseError
impl UnwindSafe for PgDatabaseError
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