Enum rune::ast::ItemVariantBody[][src]

pub enum ItemVariantBody {
    UnitBody,
    TupleBody(Parenthesized<Field, Comma>),
    StructBody(Braced<Field, Comma>),
}

An item body declaration.

Variants

UnitBody

An empty enum body.

A tuple struct body.

StructBody(Braced<Field, Comma>)

A regular struct body.

Implementations

impl ItemVariantBody[src]

pub fn fields(&self) -> impl Iterator<Item = &(Field, Option<Comma>)>[src]

Iterate over the fields of the body.

Trait Implementations

impl Clone for ItemVariantBody[src]

impl Debug for ItemVariantBody[src]

impl Eq for ItemVariantBody[src]

impl OptionSpanned for ItemVariantBody[src]

impl Parse for ItemVariantBody[src]

Parse implementation for a struct body.

Examples

use rune::{testing, ast};

testing::roundtrip::<ast::ItemVariantBody>("( a, b, c )");
testing::roundtrip::<ast::ItemVariantBody>("{ a, b, c }");
testing::roundtrip::<ast::ItemVariantBody>("( #[serde(default)] a, b, c )");
testing::roundtrip::<ast::ItemVariantBody>("{ a, #[debug(skip)] b, c }");

impl PartialEq<ItemVariantBody> for ItemVariantBody[src]

impl StructuralEq for ItemVariantBody[src]

impl StructuralPartialEq for ItemVariantBody[src]

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