pub struct TxConflictError { /* private fields */ }Expand description
The error a backend reports for a TxConflict, carrying the engine’s own
code and message and (usually) the driver error as its source.
Backend-facing: construct one, then TxConflictError::into_exec_error.
Implementations§
Source§impl TxConflictError
impl TxConflictError
Sourcepub fn new(
kind: TxConflict,
code: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn new( kind: TxConflict, code: impl Into<String>, message: impl Into<String>, ) -> Self
A conflict of kind, as the engine reported it (code is the
engine’s own: a SQLSTATE, an error number, a SQLite result code).
Sourcepub fn with_source(self, e: impl Error + Send + Sync + 'static) -> Self
pub fn with_source(self, e: impl Error + Send + Sync + 'static) -> Self
Keep the driver error underneath, so nothing is lost by classifying.
Sourcepub fn kind(&self) -> TxConflict
pub fn kind(&self) -> TxConflict
Which conflict this is.
Sourcepub fn into_exec_error(self) -> ExecError
pub fn into_exec_error(self) -> ExecError
Wrap into the error the executor traits speak. This is the one
construction TxConflict::of recognises.
Trait Implementations§
Source§impl Debug for TxConflictError
impl Debug for TxConflictError
Source§impl Display for TxConflictError
impl Display for TxConflictError
Source§impl Error for TxConflictError
impl Error for TxConflictError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for TxConflictError
impl !UnwindSafe for TxConflictError
impl Freeze for TxConflictError
impl Send for TxConflictError
impl Sync for TxConflictError
impl Unpin for TxConflictError
impl UnsafeUnpin for TxConflictError
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