pub struct ServerError {
pub code: u16,
pub sql_state: String,
pub message: String,
}Expand description
An error the server reported, carrying the code people search for.
Fields§
§code: u16§sql_state: StringThe five-character SQLSTATE, when the server sent one. Absent only from pre-4.1 servers and from a handshake that failed before negotiation.
message: StringImplementations§
Source§impl ServerError
impl ServerError
Sourcepub fn into_error(self, sql: Option<&str>) -> Error
pub fn into_error(self, sql: Option<&str>) -> Error
Render for a human, naming the code, the SQL state and the statement.
The code is the part that is searchable and the statement is the part that says where to look, so both are always present when known.
Trait Implementations§
Source§impl Clone for ServerError
impl Clone for ServerError
Source§fn clone(&self) -> ServerError
fn clone(&self) -> ServerError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ServerError
impl Debug for ServerError
Source§impl Default for ServerError
impl Default for ServerError
Source§fn default() -> ServerError
fn default() -> ServerError
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ServerError
impl RefUnwindSafe for ServerError
impl Send for ServerError
impl Sync for ServerError
impl Unpin for ServerError
impl UnsafeUnpin for ServerError
impl UnwindSafe for ServerError
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