pub struct KindMismatch {
pub nome: String,
pub expected: CaixaKind,
pub actual: CaixaKind,
}Expand description
Typed kind-mismatch view: the canonical surface every per-kind
caixa-<target> renderer raises when it’s handed a Caixa whose
:kind doesn’t match the kind that renderer is targeting. Carries
the offending caixa’s :nome alongside the expected/actual kinds,
so the diagnostic reads caixa "<nome>": expected :kind <expected>, got <actual> — naming which caixa needs author attention, not just
which kind the renderer rejected.
Lifted from three identical-shape per-renderer arms in
caixa-helm (Error::NotAServico), caixa-flux
(Error::NotAServico) and caixa-mesh
(Error::NotAnAplicacao). The prior arms each carried
only the actual CaixaKind, leaving the user to grep for which
caixa.lisp triggered the mismatch — exactly the
“feira verb whose error path doesn’t name the offending caixa”
punch-list item the compounding-mandate protocol calls out.
Renderers wrap this view in their own thiserror Error enum
via #[from]; the ? operator at every kind-checking call site
turns the require_kind result into the renderer’s local error
type with no manual conversion.
Fields§
§nome: StringThe offending caixa’s :nome — names which caixa.lisp the
renderer was handed, so the diagnostic doesn’t require the
user to grep for it.
expected: CaixaKindThe :kind this renderer targets.
actual: CaixaKindThe :kind the offending caixa actually carries.
Trait Implementations§
Source§impl Clone for KindMismatch
impl Clone for KindMismatch
Source§fn clone(&self) -> KindMismatch
fn clone(&self) -> KindMismatch
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for KindMismatch
impl Debug for KindMismatch
Source§impl Display for KindMismatch
impl Display for KindMismatch
impl Eq for KindMismatch
Source§impl Error for KindMismatch
impl Error for KindMismatch
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for KindMismatch
impl PartialEq for KindMismatch
impl StructuralPartialEq for KindMismatch
Auto Trait Implementations§
impl Freeze for KindMismatch
impl RefUnwindSafe for KindMismatch
impl Send for KindMismatch
impl Sync for KindMismatch
impl Unpin for KindMismatch
impl UnsafeUnpin for KindMismatch
impl UnwindSafe for KindMismatch
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.