[][src]Enum rhai::Stmt

[INTERNALS] A Rhai statement. Exported under the internals feature only.

Each variant is at most one pointer in size (for speed), with everything being allocated together in one single tuple.

Variants

Noop(Position)

No-op.

IfThenElse(Box<(Expr, Stmt, Option<Stmt>, Position)>)

if expr { stmt } else { stmt }

while expr { stmt }

loop { stmt }

for id in expr { stmt }

let id = expr

const id = expr

{ stmt; ... }

Expr(Box<Expr>)

expr

Continue(Position)

continue

Break(Position)

break

return/throw

import expr as module

expr id as name, ...

Convert a variable to shared.

Implementations

impl Stmt[src]

pub fn position(&self) -> Position[src]

Get the Position of this statement.

pub fn set_position(&mut self, new_pos: Position) -> &mut Self

Notable traits for &'_ mut W

impl<'_, W> Write for &'_ mut W where
    W: Write + ?Sized
impl<'_, R> Read for &'_ mut R where
    R: Read + ?Sized
impl<'_, I> Iterator for &'_ mut I where
    I: Iterator + ?Sized
type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
    F: Unpin + Future + ?Sized
type Output = <F as Future>::Output;
[src]

Override the Position of this statement.

pub fn is_self_terminated(&self) -> bool[src]

Is this statement self-terminated (i.e. no need for a semicolon terminator)?

pub fn is_pure(&self) -> bool[src]

Is this statement pure?

Trait Implementations

impl Clone for Stmt[src]

impl Debug for Stmt[src]

impl Default for Stmt[src]

impl Hash for Stmt[src]

Auto Trait Implementations

impl !RefUnwindSafe for Stmt

impl !Send for Stmt

impl !Sync for Stmt

impl Unpin for Stmt

impl !UnwindSafe for Stmt

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.