pub struct Mismatch {
pub path: String,
pub expected: HostType,
pub found: String,
}Expand description
Where a value stopped agreeing with the type declared for it, and what was found there instead.
The disagreement is reported where it happens rather than at the top of
the value: an operation declaring Result<Array<String>, Error> that
answers Ok([3]) disagrees at one element, and saying which one is the
difference between a diagnostic the host’s author can act on and one that
says only that the two do not match. Nothing here is built until a value
fails, so the path costs a run that never fails nothing at all.
Fields§
§path: StringHow the offending part is reached from the whole value, such as
Ok(_)[0]. Empty when the value itself, rather than something nested
inside it, is the disagreement.
expected: HostTypeThe type declared at that point.
found: StringWhat was found there, named the way a diagnostic names a value.
Implementations§
Trait Implementations§
impl Eq for Mismatch
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.