Struct mattro::MacroAttribute [−][src]
pub struct MacroAttribute { /* fields omitted */ }
Expand description
Represents a macro attribute and its arguments like:
#[attribute(key="value")]
Implementations
Constructs a new MacroAttribute
from an Attribute
.
pub fn from_attribute_args(
path: &str,
attribute_args: AttributeArgs,
style: AttrStyle
) -> Self
pub fn from_attribute_args(
path: &str,
attribute_args: AttributeArgs,
style: AttrStyle
) -> Self
Constructs a MacroAttribute
from an AttributeArgs
.
Returns the path
of an attribute.
For #[attribute(name="value")]
the path is "attribute"
.
Returns the arguments of the attribute.
For #[attribute(name="value", number=10)]
the arguments are "name=value"
and "number=10"
.
Returns the MetaItem
in the given index, or None
if not found.
Returns an iterator over the arguments in this attribute.
Converts this macro attribute into a name-value attribute.
Converts this macro attribute into a list of its arguments.
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for MacroAttribute
impl !Send for MacroAttribute
impl !Sync for MacroAttribute
impl Unpin for MacroAttribute
impl UnwindSafe for MacroAttribute
Blanket Implementations
Mutably borrows from an owned value. Read more