pub struct ServerError<'a> { /* private fields */ }Expand description
MySql error packet.
May hold an error or a progress report.
Implementations§
Source§impl<'a> ServerError<'a>
impl<'a> ServerError<'a>
pub fn new( code: u16, state: Option<SqlState>, msg: impl Into<Cow<'a, [u8]>>, ) -> Self
Sourcepub fn error_code(&self) -> u16
pub fn error_code(&self) -> u16
Returns an error code.
Sourcepub fn sql_state_ref(&self) -> Option<&SqlState>
pub fn sql_state_ref(&self) -> Option<&SqlState>
Returns an sql state.
Sourcepub fn message_ref(&self) -> &[u8] ⓘ
pub fn message_ref(&self) -> &[u8] ⓘ
Returns an error message.
Sourcepub fn message_str(&self) -> Cow<'_, str>
pub fn message_str(&self) -> Cow<'_, str>
Returns an error message as a string (lossy converted).
pub fn into_owned(self) -> ServerError<'static>
Trait Implementations§
Source§impl<'a> Clone for ServerError<'a>
impl<'a> Clone for ServerError<'a>
Source§fn clone(&self) -> ServerError<'a>
fn clone(&self) -> ServerError<'a>
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<'a> Debug for ServerError<'a>
impl<'a> Debug for ServerError<'a>
Source§impl Display for ServerError<'_>
impl Display for ServerError<'_>
Source§impl<'de> MyDeserialize<'de> for ServerError<'de>
impl<'de> MyDeserialize<'de> for ServerError<'de>
Source§impl MySerialize for ServerError<'_>
impl MySerialize for ServerError<'_>
Source§impl<'a> PartialEq for ServerError<'a>
impl<'a> PartialEq for ServerError<'a>
impl<'a> StructuralPartialEq for ServerError<'a>
Auto Trait Implementations§
impl<'a> Freeze for ServerError<'a>
impl<'a> RefUnwindSafe for ServerError<'a>
impl<'a> Send for ServerError<'a>
impl<'a> Sync for ServerError<'a>
impl<'a> Unpin for ServerError<'a>
impl<'a> UnwindSafe for ServerError<'a>
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