Enum macrohelper::meta::HashTag [] [src]

pub enum HashTag {
    Word(String),
    List(StringVec<Box<HashTag>>),
    NameValue(StringLit),
    Literal(Lit),
}

For arguments within #[derive ...] tag

Variants

The name of a MetaItem.

#[test] will return MetaItem::Word("Test")

A list of values

#[derive(Copy,Clone)] will return MetaItem::List("derive",vec![Box::new(MetaItem::Word("Copy")),Box::new(MetaItem::Word("Clone"))])

An assigned value

#[feature = "thing"] will return MetaItem::NameValue("feature", Literal::Str)

A literal

This isn't a first level item. It can be encountered within MetaItem::List(_, vec![]) part. It is included to prevent defining a whole extra type like syn does.

Methods

impl HashTag
[src]

Build a hashtag from a metatime

Borrow Attribute value and parse

Returns the name of the #[...] value

The literal exists so this can technically fail to return some

Get Assignment

When #[hashtag = value] is used this function will return the value half

Get List

Fetches the internal list if a hashtag like #[derive(Clone,Copy)] Which will return an array of the [Clone,Copy]

Get Literal

If the hashtag has an associated literal be it NameValue or Literal this will return that value

Get From Literal

Pre-Perform the conversion

Trait Implementations

impl Clone for HashTag
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for HashTag
[src]

Formats the value using the given formatter.