Struct rune::ast::ExprBlock [−][src]
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]
parser: &mut Parser<'_>,
attributes: Vec<Attribute>,
async_token: Option<Async>,
const_token: Option<Const>,
move_token: Option<Move>
) -> Result<Self, ParseError>
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]
fn parse(p: &mut Parser<'_>) -> Result<Self, ParseError>
[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]
fn to_tokens(&self, context: &MacroContext, stream: &mut TokenStream)
[src]
Auto Trait Implementations
impl RefUnwindSafe for ExprBlock
impl Send for ExprBlock
impl Sync for ExprBlock
impl Unpin for ExprBlock
impl UnwindSafe for ExprBlock
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>,