Trait Attribute

Source
pub trait Attribute: Send + Sync {
    // Required methods
    fn verify(&self, value: &str) -> Result<(), String>;
    fn name(&self) -> &CheetahString;
    fn is_changeable(&self) -> bool;
}
Expand description

Trait representing an attribute with name and changeability properties.

This trait is the Rust equivalent of the Java abstract class Attribute. It defines common functionality for all attribute types.

Required Methods§

Source

fn verify(&self, value: &str) -> Result<(), String>

Verify that the provided string value is valid for this attribute. Implementations should validate according to their specific rules.

Source

fn name(&self) -> &CheetahString

Get the name of this attribute.

Source

fn is_changeable(&self) -> bool

Check if this attribute can be changed after creation.

Implementors§