Trait macro_tools::AttributePropertyComponent

source ·
pub trait AttributePropertyComponent
where Self: Sized,
{ const KEYWORD: &'static str; }
Expand description

Trait for properties of an attribute component that can be identified by a keyword.

The AttributePropertyComponent trait defines the interface for attribute properties that can be identified by a specific keyword. Implementors of this trait are required to define a constant KEYWORD that identifies the type of the property.

This trait is useful in scenarios where attributes may have multiple properties that need to be parsed and handled separately. By defining a unique keyword for each property, the parsing logic can accurately identify and process each property.

§Example

use macro_tools::AttributePropertyComponent;

struct MyProperty;

impl AttributePropertyComponent for MyProperty
{
  const KEYWORD : &'static str = "my_property";
}

Required Associated Constants§

source

const KEYWORD: &'static str

The keyword that identifies the component.

This constant is used to match the attribute to the corresponding property. Each implementor of this trait must provide a unique keyword for its type.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Marker> AttributePropertyComponent for AttributePropertyBoolean<Marker>

source§

const KEYWORD: &'static str = Marker::KEYWORD

source§

impl<Marker> AttributePropertyComponent for AttributePropertyOptionalBoolean<Marker>

source§

const KEYWORD: &'static str = Marker::KEYWORD

source§

impl<Marker> AttributePropertyComponent for AttributePropertyOptionalSingletone<Marker>

source§

const KEYWORD: &'static str = Marker::KEYWORD

source§

impl<Marker> AttributePropertyComponent for AttributePropertySingletone<Marker>

source§

const KEYWORD: &'static str = Marker::KEYWORD

source§

impl<T, Marker> AttributePropertyComponent for AttributePropertyOptionalSyn<T, Marker>

source§

const KEYWORD: &'static str = Marker::KEYWORD

source§

impl<T, Marker> AttributePropertyComponent for AttributePropertySyn<T, Marker>

source§

const KEYWORD: &'static str = Marker::KEYWORD