pub struct Error {
pub code: SqlState,
pub message: String,
pub detail: Option<&'static str>,
pub hint: Option<&'static str>,
pub location: Option<usize>,
}Expand description
An error of the lexer or the parser.
Fields§
§code: SqlStateThe SQLSTATE, for example 42601.
message: StringThe primary message, as PostgreSQL writes it.
detail: Option<&'static str>The detail, or None.
hint: Option<&'static str>The hint, or None.
location: Option<usize>The byte offset in the text that the error points to, or None.
Implementations§
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<Error> for Error
impl From<Error> for Error
Source§fn from(error: Error) -> Self
fn from(error: Error) -> Self
The error of the engine with the SQLSTATE, the message, the detail and the hint. The location stays in the parser error: Error::position gives the position of the ErrorResponse.
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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