Struct rune::ast::Attribute[][src]

pub struct Attribute {
    pub hash: Pound,
    pub style: AttrStyle,
    pub open: OpenBracket,
    pub path: Path,
    pub input: TokenStream,
    pub close: CloseBracket,
}

Attribute like #[derive(Debug)]

Fields

hash: Pound

The # character

style: AttrStyle

Specify if the attribute is outer #! or inner #

open: OpenBracket

The [ character

path: Path

The path of the attribute

input: TokenStream

The input to the input of the attribute

close: CloseBracket

The ] character

Trait Implementations

impl Clone for Attribute[src]

impl Debug for Attribute[src]

impl Eq for Attribute[src]

impl Parse for Attribute[src]

Parsing an Attribute

Examples

use rune::{testing, ast};

testing::roundtrip::<ast::Attribute>("#[foo = \"foo\"]");
testing::roundtrip::<ast::Attribute>("#[foo()]");
testing::roundtrip::<ast::Attribute>("#![foo]");
testing::roundtrip::<ast::Attribute>("#![cfg(all(feature = \"potato\"))]");
testing::roundtrip::<ast::Attribute>("#[x+1]");

impl PartialEq<Attribute> for Attribute[src]

impl Peek for Attribute[src]

impl Spanned for Attribute[src]

impl StructuralEq for Attribute[src]

impl StructuralPartialEq for Attribute[src]

impl ToTokens for Attribute[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.