pub struct MappedErrors { /* private fields */ }Implementations§
Source§impl MappedErrors
impl MappedErrors
Sourcepub fn error_type(&self) -> ErrorType
pub fn error_type(&self) -> ErrorType
This method returns the error type of the current error.
Sourcepub fn code(&self) -> ErrorCodes
pub fn code(&self) -> ErrorCodes
This method returns the error code key of the current error.
Sourcepub fn has_str_code(&self, code: &str) -> bool
pub fn has_str_code(&self, code: &str) -> bool
This method returns a boolean indicating if the current error is expected or not.
pub fn is_in<T: ToString>(&self, codes: Vec<T>) -> bool
Sourcepub fn with_exp_true(self) -> Self
pub fn with_exp_true(self) -> Self
Dispatches an log error indicating unexpected error.
Sourcepub fn with_previous(self, prev: MappedErrors) -> Self
pub fn with_previous(self, prev: MappedErrors) -> Self
Include previous mapped error in message
Sourcepub fn with_error_type(self, error_type: ErrorType) -> Self
pub fn with_error_type(self, error_type: ErrorType) -> Self
Set the error type of the current error.
Sourcepub fn from_str_msg(msg: String) -> Self
pub fn from_str_msg(msg: String) -> Self
This method returns a new MappedErrors struct from a string.
Trait Implementations§
Source§impl Clone for MappedErrors
impl Clone for MappedErrors
Source§fn clone(&self) -> MappedErrors
fn clone(&self) -> MappedErrors
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 MappedErrors
impl Debug for MappedErrors
Source§impl<'de> Deserialize<'de> for MappedErrors
impl<'de> Deserialize<'de> for MappedErrors
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for MappedErrors
impl Display for MappedErrors
Source§impl Error for MappedErrors
impl Error for MappedErrors
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()
Auto Trait Implementations§
impl Freeze for MappedErrors
impl RefUnwindSafe for MappedErrors
impl Send for MappedErrors
impl Sync for MappedErrors
impl Unpin for MappedErrors
impl UnsafeUnpin for MappedErrors
impl UnwindSafe for MappedErrors
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