[−][src]Struct rune::ast::Local
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]
parser: &mut Parser<'_>,
attributes: Vec<Attribute>
) -> Result<Self, ParseError>
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]
pub fn parse(parser: &mut Parser<'_>) -> Result<Self, ParseError>
[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]
pub fn to_tokens(&self, context: &MacroContext, stream: &mut TokenStream)
[src]
Auto Trait Implementations
impl RefUnwindSafe for Local
[src]
impl Send for Local
[src]
impl Sync for Local
[src]
impl Unpin for Local
[src]
impl UnwindSafe for Local
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,