[][src]Struct full_moon::ast::Block

pub struct Block<'a> { /* fields omitted */ }

A block of statements, such as in if/do/etc block

Implementations

impl<'a> Block<'a>[src]

pub fn new() -> Self[src]

Creates an empty block

pub fn iter_stmts(&self) -> impl Iterator<Item = &Stmt<'a>>[src]

An iterator over the statements in the block, such as local foo = 1

pub fn last_stmts(&self) -> Option<&LastStmt<'a>>[src]

👎 Deprecated since 0.5.0:

Use last_stmt instead

The last statement of the block if one exists, such as return foo Deprecated in favor of Block::last_stmt, the plural in last_stmts was a typo

pub fn last_stmt(&self) -> Option<&LastStmt<'a>>[src]

The last statement of the block if one exists, such as return foo

pub fn with_stmts(
    self,
    stmts: Vec<(Stmt<'a>, Option<Cow<'a, TokenReference<'a>>>)>
) -> Self
[src]

Returns a new block with the given statements Takes a vector of statements, followed by an optional semicolon token reference

pub fn with_last_stmt(
    self,
    last_stmt: Option<(LastStmt<'a>, Option<Cow<'a, TokenReference<'a>>>)>
) -> Self
[src]

Returns a new block with the given last statement, if one is given Takes an optional last statement, with an optional semicolon

Trait Implementations

impl<'a> Clone for Block<'a>[src]

impl<'a> Debug for Block<'a>[src]

impl<'a> Default for Block<'a>[src]

impl<'de: 'a, 'a> Deserialize<'de> for Block<'a>[src]

impl<'a> Display for Block<'a>[src]

impl<'a> Node<'a> for Block<'a>[src]

impl<'a> Owned for Block<'a>[src]

type Owned = Block<'static>

What an owned version of the object looks like. Usually contains a 'static lifetime.

impl<'a> PartialEq<Block<'a>> for Block<'a>[src]

impl<'a> Serialize for Block<'a>[src]

impl<'a> StructuralPartialEq for Block<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Block<'a>

impl<'a> Send for Block<'a>

impl<'a> Sync for Block<'a>

impl<'a> Unpin for Block<'a>

impl<'a> UnwindSafe for Block<'a>

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[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> ToString for T where
    T: Display + ?Sized
[src]

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.