Struct rune::ast::ItemImpl[][src]

pub struct ItemImpl {
    pub attributes: Vec<Attribute>,
    pub impl_: Impl,
    pub path: Path,
    pub open: OpenBrace,
    pub functions: Vec<ItemFn>,
    pub close: CloseBrace,
}

An impl item.

Examples

use rune::{testing, ast};

testing::roundtrip::<ast::ItemImpl>("impl Foo {}");
testing::roundtrip::<ast::ItemImpl>("impl Foo { fn test(self) { } }");
testing::roundtrip::<ast::ItemImpl>("#[variant(enum_= \"SuperHero\", x = \"1\")] impl Foo { fn test(self) { } }");
testing::roundtrip::<ast::ItemImpl>("#[xyz] impl Foo { #[jit] fn test(self) { } }");

Fields

attributes: Vec<Attribute>

The attributes of the impl block

impl_: Impl

The impl keyword.

path: Path

Path of the implementation.

open: OpenBrace

The open brace.

functions: Vec<ItemFn>

The collection of functions.

close: CloseBrace

The close brace.

Implementations

impl ItemImpl[src]

pub fn parse_with_attributes(
    parser: &mut Parser<'_>,
    attributes: Vec<Attribute>
) -> Result<Self, ParseError>
[src]

Parse an impl item with the given attributes.

Trait Implementations

impl Clone for ItemImpl[src]

impl Debug for ItemImpl[src]

impl Eq for ItemImpl[src]

impl Parse for ItemImpl[src]

impl PartialEq<ItemImpl> for ItemImpl[src]

impl Spanned for ItemImpl[src]

impl StructuralEq for ItemImpl[src]

impl StructuralPartialEq for ItemImpl[src]

impl ToTokens for ItemImpl[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.