pub struct EnumExtractValueError<T> {
pub source: EnumExtractError,
pub value: T,
}
Expand description
An error that occurs when the actual variant does not match the expected variant.
This error is only produced by functions that consume the value, and therefore holds on to the value in case it is needed.
Fields§
§source: EnumExtractError
The inner extraction error.
value: T
The value of the actual variant.
Implementations§
source§impl<T> EnumExtractValueError<T>
impl<T> EnumExtractValueError<T>
sourcepub fn from_plain_error(extract_error: EnumExtractError, value: T) -> Self
pub fn from_plain_error(extract_error: EnumExtractError, value: T) -> Self
Create a new EnumExtractError
.
sourcepub fn new(expected: &'static str, actual: &'static str, value: T) -> Self
pub fn new(expected: &'static str, actual: &'static str, value: T) -> Self
Create a new EnumExtractError
.
Trait Implementations§
source§impl<T: Debug> Debug for EnumExtractValueError<T>
impl<T: Debug> Debug for EnumExtractValueError<T>
source§impl<T> Display for EnumExtractValueError<T>
impl<T> Display for EnumExtractValueError<T>
source§impl<T> Error for EnumExtractValueError<T>
impl<T> Error for EnumExtractValueError<T>
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()
source§impl<T> From<EnumExtractValueError<T>> for EnumExtractError
impl<T> From<EnumExtractValueError<T>> for EnumExtractError
source§fn from(value: EnumExtractValueError<T>) -> Self
fn from(value: EnumExtractValueError<T>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<T> RefUnwindSafe for EnumExtractValueError<T>where
T: RefUnwindSafe,
impl<T> Send for EnumExtractValueError<T>where
T: Send,
impl<T> Sync for EnumExtractValueError<T>where
T: Sync,
impl<T> Unpin for EnumExtractValueError<T>where
T: Unpin,
impl<T> UnwindSafe for EnumExtractValueError<T>where
T: UnwindSafe,
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