[][src]Struct full_moon::ast::If

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

An if statement

Implementations

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

pub fn new(condition: Expression<'a>) -> Self[src]

Creates a new If from the given condition

pub fn if_token(&self) -> &TokenReference<'a>[src]

The if token

pub fn condition(&self) -> &Expression<'a>[src]

The condition of the if statement, condition in if condition then

pub fn then_token(&self) -> &TokenReference<'a>[src]

The then token

pub fn block(&self) -> &Block<'a>[src]

The block inside the initial if statement

pub fn else_token(&self) -> Option<&TokenReference<'a>>[src]

The else token if one exists

pub fn else_if(&self) -> Option<&Vec<ElseIf<'a>>>[src]

If there are elseif conditions, returns a vector of them Expression is the condition, block is the code if the condition is true

pub fn else_block(&self) -> Option<&Block<'a>>[src]

The code inside an else block if one exists

pub fn end_token(&self) -> &TokenReference<'a>[src]

The end token

pub fn with_if_token(self, if_token: Cow<'a, TokenReference<'a>>) -> Self[src]

Returns a new If with the given if token

pub fn with_condition(self, condition: Expression<'a>) -> Self[src]

Returns a new If with the given condition

pub fn with_then_token(self, then_token: Cow<'a, TokenReference<'a>>) -> Self[src]

Returns a new If with the given then token

pub fn with_block(self, block: Block<'a>) -> Self[src]

Returns a new If with the given block

pub fn with_else_if(self, else_if: Option<Vec<ElseIf<'a>>>) -> Self[src]

Returns a new If with the given list of elseif blocks

pub fn with_else_token(
    self,
    else_token: Option<Cow<'a, TokenReference<'a>>>
) -> Self
[src]

Returns a new If with the given else token

pub fn with_else(self, r#else: Option<Block<'a>>) -> Self[src]

Returns a new If with the given else body

pub fn with_end_token(self, end_token: Cow<'a, TokenReference<'a>>) -> Self[src]

Returns a new If with the given end token

Trait Implementations

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

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

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

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

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

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

type Owned = If<'static>

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

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

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

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

Auto Trait Implementations

impl<'a> RefUnwindSafe for If<'a>

impl<'a> Send for If<'a>

impl<'a> Sync for If<'a>

impl<'a> Unpin for If<'a>

impl<'a> UnwindSafe for If<'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.