Enum rune::ast::Item[][src]

pub enum Item {
    Use(Box<ItemUse>),
    Fn(Box<ItemFn>),
    Enum(Box<ItemEnum>),
    Struct(Box<ItemStruct>),
    Impl(Box<ItemImpl>),
    Mod(Box<ItemMod>),
    Const(Box<ItemConst>),
    MacroCall(Box<MacroCall>),
}

A declaration.

Variants

Use(Box<ItemUse>)

A use declaration.

Fn(Box<ItemFn>)

A function declaration.

Enum(Box<ItemEnum>)

An enum declaration.

Struct(Box<ItemStruct>)

A struct declaration.

Impl(Box<ItemImpl>)

An impl declaration.

Mod(Box<ItemMod>)

A module declaration.

Const(Box<ItemConst>)

A const declaration.

MacroCall(Box<MacroCall>)

A macro call expanding into an item.

Implementations

impl Item[src]

pub fn needs_semi_colon(&self) -> bool[src]

Indicates if the declaration needs a semi-colon or not.

pub fn take_attributes(&mut self) -> Vec<Attribute>[src]

Take the attributes associated with the item.

pub fn attributes(&self) -> &[Attribute][src]

Test if the item has any attributes

pub fn peek_as_item(p: &mut Peeker<'_>, path: Option<&Path>) -> bool[src]

Test if declaration is suitable inside of a file.

pub fn parse_with_meta_path(
    p: &mut Parser<'_>,
    attributes: Vec<Attribute>,
    visibility: Visibility,
    path: Option<Path>
) -> Result<Self, ParseError>
[src]

Parse an Item attaching the given meta and optional path.

Trait Implementations

impl Clone for Item[src]

impl Debug for Item[src]

impl Eq for Item[src]

impl Parse for Item[src]

impl PartialEq<Item> for Item[src]

impl Spanned for Item[src]

impl StructuralEq for Item[src]

impl StructuralPartialEq for Item[src]

impl ToTokens for Item[src]

Auto Trait Implementations

impl RefUnwindSafe for Item

impl Send for Item

impl Sync for Item

impl Unpin for Item

impl UnwindSafe for Item

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.