pub enum Error {
Database {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
NotFound(String),
Validation(String),
Privacy(String),
Internal(String),
Serialization {
message: String,
source: Option<Error>,
},
PendingDeletion(String),
Identity(String),
}Variants§
Database
NotFound(String)
Validation(String)
Privacy(String)
Internal(String)
Serialization
PendingDeletion(String)
Identity(String)
Implementations§
Source§impl Error
impl Error
Sourcepub fn database(msg: impl AsRef<str>) -> Self
pub fn database(msg: impl AsRef<str>) -> Self
Build a Error::Database with URL userinfo redacted from the message.
Sourcepub fn database_with_source(
msg: impl AsRef<str>,
source: impl Error + Send + Sync + 'static,
) -> Self
pub fn database_with_source( msg: impl AsRef<str>, source: impl Error + Send + Sync + 'static, ) -> Self
Build a Error::Database with a typed source cause and redacted message.
Sourcepub fn serialization(e: Error) -> Self
pub fn serialization(e: Error) -> Self
Build a Error::Serialization that preserves the serde_json cause.
Sourcepub fn serialization_msg(msg: impl Into<String>) -> Self
pub fn serialization_msg(msg: impl Into<String>) -> Self
Build a Error::Serialization from a message when no serde cause is available.
Sourcepub fn is_retryable_transaction_contention(&self) -> bool
pub fn is_retryable_transaction_contention(&self) -> bool
True when the database engine reported MVCC / transaction contention that may succeed on retry.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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 Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin 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