Struct rune::ast::ExprBlock[][src]

pub struct ExprBlock {
    pub attributes: Vec<Attribute>,
    pub async_token: Option<Async>,
    pub const_token: Option<Const>,
    pub move_token: Option<Move>,
    pub block: Block,
}

A block expression.

Examples

use rune::{testing, ast};

let expr = testing::roundtrip::<ast::ExprBlock>("async {}");
assert_eq!(expr.block.statements.len(), 0);

let expr = testing::roundtrip::<ast::ExprBlock>("async { 42 }");
assert_eq!(expr.block.statements.len(), 1);

let expr = testing::roundtrip::<ast::ExprBlock>("#[retry] async { 42 }");
assert_eq!(expr.block.statements.len(), 1);
assert_eq!(expr.attributes.len(), 1);

Fields

attributes: Vec<Attribute>

The attributes for the block.

async_token: Option<Async>

The optional async token.

const_token: Option<Const>

The optional const token.

move_token: Option<Move>

The optional move token.

block: Block

The close brace.

Implementations

impl ExprBlock[src]

pub fn parse_with_meta(
    parser: &mut Parser<'_>,
    attributes: Vec<Attribute>,
    async_token: Option<Async>,
    const_token: Option<Const>,
    move_token: Option<Move>
) -> Result<Self, ParseError>
[src]

Parse #ident and attach the given meta

Trait Implementations

impl Clone for ExprBlock[src]

impl Debug for ExprBlock[src]

impl Eq for ExprBlock[src]

impl Parse for ExprBlock[src]

impl PartialEq<ExprBlock> for ExprBlock[src]

impl Spanned for ExprBlock[src]

impl StructuralEq for ExprBlock[src]

impl StructuralPartialEq for ExprBlock[src]

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