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: SymbolOpen symbol naming the hint kind.
title: StringShort human-readable title.
detail: Option<String>Optional longer detail text.
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
impl HintMetadata
Sourcepub fn new(kind: Symbol, title: impl Into<String>) -> Self
pub fn new(kind: Symbol, title: impl Into<String>) -> Self
Builds a hint with a kind and title.
Sourcepub fn with_detail(self, detail: impl Into<String>) -> Self
pub fn with_detail(self, detail: impl Into<String>) -> Self
Adds longer detail text.
Sourcepub fn with_argument(self, argument: Symbol) -> Self
pub fn with_argument(self, argument: Symbol) -> Self
Adds an argument name or position.
Sourcepub fn with_capability(self, capability: CapabilityName) -> Self
pub fn with_capability(self, capability: CapabilityName) -> Self
Adds a capability requirement.
Sourcepub fn with_codec_form(self, form: Symbol) -> Self
pub fn with_codec_form(self, form: Symbol) -> Self
Adds a codec-safe form tag.
Sourcepub fn with_example(self, example: impl Into<String>) -> Self
pub fn with_example(self, example: impl Into<String>) -> Self
Adds a short example.
Sourcepub fn attach_to(self, diagnostic: Diagnostic) -> Diagnostic
pub fn attach_to(self, diagnostic: Diagnostic) -> Diagnostic
Appends this hint to a diagnostic as a related metadata carrier.
Sourcepub fn to_diagnostic(&self) -> Diagnostic
pub fn to_diagnostic(&self) -> Diagnostic
Converts this hint into a related diagnostic carrier.
Sourcepub fn from_diagnostic(diagnostic: &Diagnostic) -> Option<Self>
pub fn from_diagnostic(diagnostic: &Diagnostic) -> Option<Self>
Reconstructs hint metadata from a related diagnostic carrier.
Sourcepub fn is_hint_diagnostic(diagnostic: &Diagnostic) -> bool
pub fn is_hint_diagnostic(diagnostic: &Diagnostic) -> bool
Returns whether a diagnostic is a hint metadata carrier.
Sourcepub fn collect_from_diagnostic(diagnostic: &Diagnostic) -> Vec<Self>
pub fn collect_from_diagnostic(diagnostic: &Diagnostic) -> Vec<Self>
Collects the direct hint carriers attached to a diagnostic.
Sourcepub fn radar_text(&self) -> String
pub fn radar_text(&self) -> String
Builds a text field suitable for simple agent or Radar-style indexing.
Trait Implementations§
Source§impl Clone for HintMetadata
impl Clone for HintMetadata
Source§fn clone(&self) -> HintMetadata
fn clone(&self) -> HintMetadata
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 HintMetadata
impl Debug for HintMetadata
impl Eq for HintMetadata
Source§impl PartialEq for HintMetadata
impl PartialEq for HintMetadata
Source§fn eq(&self, other: &HintMetadata) -> bool
fn eq(&self, other: &HintMetadata) -> bool
self and other values to be equal, and is used by ==.