Struct PgDatabaseError
pub struct PgDatabaseError(pub(crate) Notice);
Expand description
An error returned from the PostgreSQL database.
Tuple Fields§
§0: Notice
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>
§fn table(&self) -> Option<&str>
fn table(&self) -> Option<&str>
§fn is_unique_violation(&self) -> bool
fn is_unique_violation(&self) -> bool
§fn is_foreign_key_violation(&self) -> bool
fn is_foreign_key_violation(&self) -> bool
§fn is_check_violation(&self) -> bool
fn is_check_violation(&self) -> bool
§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 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl !Freeze for PgDatabaseError
impl RefUnwindSafe for PgDatabaseError
impl Send for PgDatabaseError
impl Sync for PgDatabaseError
impl Unpin for PgDatabaseError
impl UnwindSafe for PgDatabaseError
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more