pub struct Mismatch {
pub type_name: &'static str,
pub expected: &'static str,
pub found: &'static str,
}Expand description
A delta that does not fit the value it was applied to.
Only enums can produce this — a delta built while the value was one variant
arriving at a value that is now another — which means the two sides have
already diverged. A struct’s apply_delta never fails, and neither does
one for an enum whose value is in the expected variant.
Nested deltas propagate the innermost mismatch rather than wrapping it, so the type and variant named here are the ones that actually disagreed, not the outermost thing being applied.
Fields§
§type_name: &'static strThe enum whose delta did not fit, as written in its definition.
expected: &'static strThe variant the delta was computed for.
found: &'static strThe variant the value was actually in.
Trait Implementations§
impl Copy for Mismatch
impl Eq for Mismatch
Source§impl Error for Mismatch
impl Error for Mismatch
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()
impl StructuralPartialEq for Mismatch
Auto Trait Implementations§
impl Freeze for Mismatch
impl RefUnwindSafe for Mismatch
impl Send for Mismatch
impl Sync for Mismatch
impl Unpin for Mismatch
impl UnsafeUnpin for Mismatch
impl UnwindSafe for Mismatch
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