Trait AttributeExtension

Source
pub trait AttributeExtension {
    // Required method
    fn get_self(&self) -> &Attribute;

    // Provided methods
    fn parse_comma_args<T: Parse>(&self) -> Result<Vec<T>> { ... }
    fn unfeatured(&self) -> Option<Attribute> { ... }
}

Required Methods§

Provided Methods§

Source

fn parse_comma_args<T: Parse>(&self) -> Result<Vec<T>>

Parse all arguments as comma-separated types.

Source

fn unfeatured(&self) -> Option<Attribute>

Unwrap the feature flag from the attribute. E.g. #[cfg_attr(feature = "some_feature", derive(Debug))] becomes the syn::Meta defined as derive(Debug).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl AttributeExtension for Attribute

Implementors§