Struct clean_base::utils::errors::MappedErrors
source · 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(&self, codes: Vec<&str>) -> 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 copy 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 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)>
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 MappedErrors
impl Send for MappedErrors
impl Sync for MappedErrors
impl Unpin 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