[−][src]Struct full_moon::ast::If
An if statement
Methods
impl<'a> If<'a>
[src]
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
Trait Implementations
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.
fn owned(&self) -> Self::Owned
[src]
impl<'a> Node for If<'a>
[src]
fn start_position(&self) -> Option<Position>
[src]
fn end_position(&self) -> Option<Position>
[src]
fn range(&self) -> Option<(Position, Position)>
[src]
fn surrounding_ignore_tokens<'ast, 'b>(
&self,
ast: &'b Ast<'ast>
) -> Option<(Vec<&'b Token<'ast>>, Vec<&'b Token<'ast>>)>
[src]
&self,
ast: &'b Ast<'ast>
) -> Option<(Vec<&'b Token<'ast>>, Vec<&'b Token<'ast>>)>
impl<'a> Clone for If<'a>
[src]
impl<'a> PartialEq<If<'a>> for If<'a>
[src]
impl<'a> Debug for If<'a>
[src]
impl<'a> Serialize for If<'a>
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de: 'a, 'a> Deserialize<'de> for If<'a>
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl<'a> Send for If<'a>
impl<'a> Sync for If<'a>
impl<'a> Unpin for If<'a>
impl<'a> !UnwindSafe for If<'a>
impl<'a> !RefUnwindSafe for If<'a>
Blanket Implementations
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.
fn to_owned(&self) -> T
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,