pub struct TokenError { /* private fields */ }Expand description
An error token returned from the server.
Implementations§
Source§impl TokenError
impl TokenError
Sourcepub fn code(&self) -> u32
pub fn code(&self) -> u32
The error code, see descriptions from the manual.
Sourcepub fn class(&self) -> u8
pub fn class(&self) -> u8
The class (severity) of the error. A class of less than 10 indicates an informational message.
Sourcepub fn line(&self) -> u32
pub fn line(&self) -> u32
The line number in the SQL batch or stored procedure that caused the error. Line numbers begin at 1. If the line number is not applicable to the message, the value is 0.
Sourcepub fn other_errors(&self) -> &[TokenError]
pub fn other_errors(&self) -> &[TokenError]
The ERROR tokens that followed this one in the same response, in order. A batch keeps running after most errors, so later statements can fail too. Empty on the entries themselves.
Sourcepub fn info_messages(&self) -> &[TokenError]
pub fn info_messages(&self) -> &[TokenError]
The INFO messages of the same response, before and after this error,
in order: PRINT output, RAISERROR at severity 10 or less, and
server notices. code is the message number.
Trait Implementations§
Source§impl Clone for TokenError
impl Clone for TokenError
Source§impl Debug for TokenError
impl Debug for TokenError
Source§impl Display for TokenError
impl Display for TokenError
impl Eq for TokenError
Source§impl Error for TokenError
impl Error for TokenError
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 PartialEq for TokenError
impl PartialEq for TokenError
impl StructuralPartialEq for TokenError
Auto Trait Implementations§
impl Freeze for TokenError
impl RefUnwindSafe for TokenError
impl Send for TokenError
impl Sync for TokenError
impl Unpin for TokenError
impl UnsafeUnpin for TokenError
impl UnwindSafe for TokenError
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