Struct darklua_core::nodes::ReturnStatement
source · [−]pub struct ReturnStatement { /* private fields */ }Implementations
sourceimpl ReturnStatement
impl ReturnStatement
pub fn new(expressions: Vec<Expression>) -> Self
sourcepub fn one<E: Into<Expression>>(expression: E) -> Self
pub fn one<E: Into<Expression>>(expression: E) -> Self
Creates a new ReturnStatement with one expression.
let statement = ReturnStatement::one(Expression::from(true));
// unknown case
assert_eq!(statement.len(), 1);pub fn with_expression<E: Into<Expression>>(self, expression: E) -> Self
pub fn iter_expressions(&self) -> impl Iterator<Item = &Expression>
pub fn into_iter_expressions(self) -> impl Iterator<Item = Expression>
pub fn iter_mut_expressions(&mut self) -> impl Iterator<Item = &mut Expression>
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn with_tokens(self, tokens: ReturnTokens) -> Self
pub fn set_tokens(&mut self, tokens: ReturnTokens)
pub fn get_tokens(&self) -> Option<&ReturnTokens>
pub fn clear_comments(&mut self)
pub fn clear_whitespaces(&mut self)
Trait Implementations
sourceimpl Clone for ReturnStatement
impl Clone for ReturnStatement
sourcefn clone(&self) -> ReturnStatement
fn clone(&self) -> ReturnStatement
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for ReturnStatement
impl Debug for ReturnStatement
sourceimpl Default for ReturnStatement
impl Default for ReturnStatement
sourcefn default() -> ReturnStatement
fn default() -> ReturnStatement
Returns the “default value” for a type. Read more
sourceimpl From<ReturnStatement> for Block
impl From<ReturnStatement> for Block
sourcefn from(statement: ReturnStatement) -> Block
fn from(statement: ReturnStatement) -> Block
Converts to this type from the input type.
sourceimpl From<ReturnStatement> for LastStatement
impl From<ReturnStatement> for LastStatement
sourcefn from(statement: ReturnStatement) -> Self
fn from(statement: ReturnStatement) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<ReturnStatement> for ReturnStatement
impl PartialEq<ReturnStatement> for ReturnStatement
sourcefn eq(&self, other: &ReturnStatement) -> bool
fn eq(&self, other: &ReturnStatement) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &ReturnStatement) -> bool
fn ne(&self, other: &ReturnStatement) -> bool
This method tests for !=.
impl Eq for ReturnStatement
impl StructuralEq for ReturnStatement
impl StructuralPartialEq for ReturnStatement
Auto Trait Implementations
impl RefUnwindSafe for ReturnStatement
impl Send for ReturnStatement
impl Sync for ReturnStatement
impl Unpin for ReturnStatement
impl UnwindSafe for ReturnStatement
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more