Struct rune::ast::ExprYield[][src]

pub struct ExprYield {
    pub attributes: Vec<Attribute>,
    pub yield_token: Yield,
    pub expr: Option<Expr>,
}

A yield [expr] expression to return a value from a generator.

Examples

use rune::{testing, ast};

testing::roundtrip::<ast::ExprYield>("yield");
testing::roundtrip::<ast::ExprYield>("yield 42");
testing::roundtrip::<ast::ExprYield>("#[attr] yield 42");

Fields

attributes: Vec<Attribute>

The attributes of the yield

yield_token: Yield

The return token.

expr: Option<Expr>

An optional expression to yield.

Implementations

impl ExprYield[src]

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

Parse #ident and attach the given meta

Trait Implementations

impl Clone for ExprYield[src]

impl Debug for ExprYield[src]

impl Eq for ExprYield[src]

impl Parse for ExprYield[src]

impl PartialEq<ExprYield> for ExprYield[src]

impl Spanned for ExprYield[src]

impl StructuralEq for ExprYield[src]

impl StructuralPartialEq for ExprYield[src]

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