Skip to main content

HintMetadata

Struct HintMetadata 

Source
pub struct HintMetadata {
    pub kind: Symbol,
    pub title: String,
    pub detail: Option<String>,
    pub tags: Vec<Symbol>,
    pub arguments: Vec<Symbol>,
    pub capabilities: Vec<CapabilityName>,
    pub codec_forms: Vec<Symbol>,
    pub examples: Vec<String>,
}
Expand description

Open metadata that helps tools explain or route a diagnostic or operation.

The kind symbol is intentionally open. The remaining fields are common slots used by shape checkers, runtime libraries, and agent-facing indexes to expose expected inputs, argument names, capability requirements, examples, and codec-safe surface forms without adding closed kernel enums.

Fields§

§kind: Symbol

Open symbol naming the hint kind.

§title: String

Short human-readable title.

§detail: Option<String>

Optional longer detail text.

§tags: Vec<Symbol>

Searchable open tags.

§arguments: Vec<Symbol>

Argument names or positions the hint describes.

§capabilities: Vec<CapabilityName>

Capabilities required to follow the hint.

§codec_forms: Vec<Symbol>

Codec-safe forms related to this hint.

§examples: Vec<String>

Short examples a tool can show or index.

Implementations§

Source§

impl HintMetadata

Source

pub fn new(kind: Symbol, title: impl Into<String>) -> Self

Builds a hint with a kind and title.

Source

pub fn with_detail(self, detail: impl Into<String>) -> Self

Adds longer detail text.

Source

pub fn with_tag(self, tag: Symbol) -> Self

Adds a searchable tag.

Source

pub fn with_argument(self, argument: Symbol) -> Self

Adds an argument name or position.

Source

pub fn with_capability(self, capability: CapabilityName) -> Self

Adds a capability requirement.

Source

pub fn with_codec_form(self, form: Symbol) -> Self

Adds a codec-safe form tag.

Source

pub fn with_example(self, example: impl Into<String>) -> Self

Adds a short example.

Source

pub fn attach_to(self, diagnostic: Diagnostic) -> Diagnostic

Appends this hint to a diagnostic as a related metadata carrier.

Source

pub fn to_diagnostic(&self) -> Diagnostic

Converts this hint into a related diagnostic carrier.

Source

pub fn from_diagnostic(diagnostic: &Diagnostic) -> Option<Self>

Reconstructs hint metadata from a related diagnostic carrier.

Source

pub fn is_hint_diagnostic(diagnostic: &Diagnostic) -> bool

Returns whether a diagnostic is a hint metadata carrier.

Source

pub fn collect_from_diagnostic(diagnostic: &Diagnostic) -> Vec<Self>

Collects the direct hint carriers attached to a diagnostic.

Source

pub fn radar_text(&self) -> String

Builds a text field suitable for simple agent or Radar-style indexing.

Source

pub fn as_value(&self, cx: &mut Cx) -> Result<Value>

Projects the hint as a runtime table value.

Source

pub fn as_datum(&self) -> Datum

Projects the hint as a datum node.

Trait Implementations§

Source§

impl Clone for HintMetadata

Source§

fn clone(&self) -> HintMetadata

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HintMetadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for HintMetadata

Source§

impl PartialEq for HintMetadata

Source§

fn eq(&self, other: &HintMetadata) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for HintMetadata

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.