Struct rune::ast::Local[][src]

pub struct Local {
    pub attributes: Vec<Attribute>,
    pub let_token: Let,
    pub pat: Pat,
    pub eq: Eq,
    pub expr: Expr,
    pub semi: SemiColon,
}

A local variable declaration let <pattern> = <expr>;

Examples

use rune::{testing, ast};

testing::roundtrip::<ast::Local>("let x = 1;");
testing::roundtrip::<ast::Local>("#[attr] let a = f();");
testing::roundtrip::<ast::Local>("let a = b{}().foo[0].await;");

Fields

attributes: Vec<Attribute>

The attributes for the let expression

let_token: Let

The let keyword.

pat: Pat

The name of the binding.

eq: Eq

The equality keyword.

expr: Expr

The expression the binding is assigned to.

semi: SemiColon

Trailing semicolon of the local.

Implementations

impl Local[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 Local[src]

impl Debug for Local[src]

impl Eq for Local[src]

impl Parse for Local[src]

impl PartialEq<Local> for Local[src]

impl Spanned for Local[src]

impl StructuralEq for Local[src]

impl StructuralPartialEq for Local[src]

impl ToTokens for Local[src]

Auto Trait Implementations

impl RefUnwindSafe for Local

impl Send for Local

impl Sync for Local

impl Unpin for Local

impl UnwindSafe for Local

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.