pub struct ErrorFields {Show 18 fields
pub severity: String,
pub severity_localized: Option<String>,
pub code: String,
pub message: String,
pub detail: Option<String>,
pub hint: Option<String>,
pub position: Option<i32>,
pub internal_position: Option<i32>,
pub internal_query: Option<String>,
pub where_: Option<String>,
pub schema: Option<String>,
pub table: Option<String>,
pub column: Option<String>,
pub data_type: Option<String>,
pub constraint: Option<String>,
pub file: Option<String>,
pub line: Option<i32>,
pub routine: Option<String>,
}Expand description
Error and notice response fields.
PostgreSQL error responses contain multiple fields identified by single-byte codes. All fields are optional except severity, code, and message.
Fields§
§severity: StringSeverity (ERROR, FATAL, PANIC, WARNING, NOTICE, DEBUG, INFO, LOG)
severity_localized: Option<String>Localized severity (for display)
code: StringSQLSTATE code (e.g., “23505” for unique_violation)
message: StringPrimary error message
detail: Option<String>Optional secondary message with more detail
hint: Option<String>Optional suggestion for fixing the problem
position: Option<i32>Position in query string (1-based)
internal_position: Option<i32>Position in internal query
internal_query: Option<String>Internal query that generated the error
where_: Option<String>Call stack context
schema: Option<String>Schema name
table: Option<String>Table name
column: Option<String>Column name
data_type: Option<String>Data type name
constraint: Option<String>Constraint name
file: Option<String>Source file name
line: Option<i32>Source line number
routine: Option<String>Source routine name
Implementations§
Source§impl ErrorFields
impl ErrorFields
Sourcepub fn is_warning(&self) -> bool
pub fn is_warning(&self) -> bool
Check if this is a warning or notice.
Sourcepub fn error_class(&self) -> &str
pub fn error_class(&self) -> &str
Get the SQLSTATE error class (first two characters).
Trait Implementations§
Source§impl Clone for ErrorFields
impl Clone for ErrorFields
Source§fn clone(&self) -> ErrorFields
fn clone(&self) -> ErrorFields
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ErrorFields
impl Debug for ErrorFields
Source§impl Default for ErrorFields
impl Default for ErrorFields
Source§fn default() -> ErrorFields
fn default() -> ErrorFields
Returns the “default value” for a type. Read more
Source§impl Display for ErrorFields
impl Display for ErrorFields
Source§impl PartialEq for ErrorFields
impl PartialEq for ErrorFields
impl Eq for ErrorFields
impl StructuralPartialEq for ErrorFields
Auto Trait Implementations§
impl Freeze for ErrorFields
impl RefUnwindSafe for ErrorFields
impl Send for ErrorFields
impl Sync for ErrorFields
impl Unpin for ErrorFields
impl UnwindSafe for ErrorFields
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).