TraitPlugin

Trait TraitPlugin 

Source
pub trait TraitPlugin: Send + Sync {
    // Required methods
    fn id(&self) -> &str;
    fn name(&self) -> &str;
    fn meta(&self) -> &PluginMeta;
    fn value_types(&self) -> &[String];
    fn check(&self, value: &CoreValue) -> Option<String>;
}
Expand description

Trait for trait plugins that observe properties of values.

Required Methods§

Source

fn id(&self) -> &str

Unique identifier for this trait (e.g., “is-lucky”).

Source

fn name(&self) -> &str

Human-readable name (e.g., “Lucky Number”).

Source

fn meta(&self) -> &PluginMeta

Plugin metadata.

Source

fn value_types(&self) -> &[String]

Value types this trait checks (e.g., [“int”]). Empty means it checks all types.

Source

fn check(&self, value: &CoreValue) -> Option<String>

Check if the trait applies to the value.

Returns the trait description (e.g., “Lucky number (42)”) or None.

Implementors§