Attribute Macro arg_description

Source
#[arg_description]
Expand description

The arg_description attribute is a procedural macro used to provide additional description for an enum.

This attribute does not modify the code it annotates but instead attaches metadata in the form of a description. This isn’t required. It will be passed as a description if present, which can result in better argument selection.

§Usage

#[arg_description(description = "This is a sample enum.", tokens = 5)]
#[derive(EnumDescriptor)]
pub enum SampleEnum {
    Variant1,
    Variant2,
}

Note: The actual usage of the description and tokens provided through this attribute happens in the EnumDescriptor derive macro and is retrieved in the enum_descriptor_derive function.

The arg_description attribute takes one argument, description, which is a string literal.