pub struct TypeWitness {
pub type: String,
pub witness: Option<Value>,
}Expand description
A type witness — a concrete value that satisfies (expected) or
violates (found) the type constraint at the diagnostic site, per
ADR-006 §9.3.
r#type is the type’s surface name (e.g. "int", "string",
"Array<int>"). witness is an optional concrete example value.
For simple primitive types (int, number, bool, string), the
emitter is encouraged to populate witness. For recursive / generic /
trait-bounded types, witness may be None; the surface name alone
communicates the constraint.
Fields§
§type: StringSurface name of the type ("int", "Option<string>", …).
witness: Option<Value>Optional concrete value satisfying or violating the constraint. Encoded as a JSON value; LLM consumers parse it directly.
Implementations§
Trait Implementations§
Source§impl Clone for TypeWitness
impl Clone for TypeWitness
Source§fn clone(&self) -> TypeWitness
fn clone(&self) -> TypeWitness
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TypeWitness
impl Debug for TypeWitness
Source§impl<'de> Deserialize<'de> for TypeWitness
impl<'de> Deserialize<'de> for TypeWitness
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 PartialEq for TypeWitness
impl PartialEq for TypeWitness
Source§fn eq(&self, other: &TypeWitness) -> bool
fn eq(&self, other: &TypeWitness) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TypeWitness
impl Serialize for TypeWitness
impl StructuralPartialEq for TypeWitness
Auto Trait Implementations§
impl Freeze for TypeWitness
impl RefUnwindSafe for TypeWitness
impl Send for TypeWitness
impl Sync for TypeWitness
impl Unpin for TypeWitness
impl UnsafeUnpin for TypeWitness
impl UnwindSafe for TypeWitness
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