pub struct GenericForStatement { /* private fields */ }
Expand description
Represents a generic for loop statement.
Implementations§
Source§impl GenericForStatement
impl GenericForStatement
Sourcepub fn new<B: Into<Block>>(
identifiers: Vec<TypedIdentifier>,
expressions: Vec<Expression>,
block: B,
) -> Self
pub fn new<B: Into<Block>>( identifiers: Vec<TypedIdentifier>, expressions: Vec<Expression>, block: B, ) -> Self
Creates a new generic for statement.
Sourcepub fn with_tokens(self, tokens: GenericForTokens) -> Self
pub fn with_tokens(self, tokens: GenericForTokens) -> Self
Sets the tokens for this generic for statement.
Sourcepub fn set_tokens(&mut self, tokens: GenericForTokens)
pub fn set_tokens(&mut self, tokens: GenericForTokens)
Sets the tokens for this generic for statement.
Sourcepub fn get_tokens(&self) -> Option<&GenericForTokens>
pub fn get_tokens(&self) -> Option<&GenericForTokens>
Returns the tokens for this generic for statement, if any.
Sourcepub fn mutate_tokens(&mut self) -> Option<&mut GenericForTokens>
pub fn mutate_tokens(&mut self) -> Option<&mut GenericForTokens>
Returns a mutable reference to the tokens, if any.
Sourcepub fn get_identifiers(&self) -> &Vec<TypedIdentifier>
pub fn get_identifiers(&self) -> &Vec<TypedIdentifier>
Returns the list of identifiers that receive iterator values.
Sourcepub fn iter_identifiers(&self) -> impl Iterator<Item = &TypedIdentifier>
pub fn iter_identifiers(&self) -> impl Iterator<Item = &TypedIdentifier>
Returns an iterator over the identifiers.
Sourcepub fn get_expressions(&self) -> &Vec<Expression>
pub fn get_expressions(&self) -> &Vec<Expression>
Returns the list of expressions that produce the iterator values.
Sourcepub fn iter_expressions(&self) -> impl Iterator<Item = &Expression>
pub fn iter_expressions(&self) -> impl Iterator<Item = &Expression>
Returns an iterator over the expressions.
Sourcepub fn iter_mut_identifiers(
&mut self,
) -> impl Iterator<Item = &mut TypedIdentifier>
pub fn iter_mut_identifiers( &mut self, ) -> impl Iterator<Item = &mut TypedIdentifier>
Returns a mutable iterator over the identifiers.
Sourcepub fn iter_mut_expressions(&mut self) -> impl Iterator<Item = &mut Expression>
pub fn iter_mut_expressions(&mut self) -> impl Iterator<Item = &mut Expression>
Returns a mutable iterator over the expressions.
Sourcepub fn mutate_expressions(&mut self) -> &mut Vec<Expression>
pub fn mutate_expressions(&mut self) -> &mut Vec<Expression>
Returns a mutable reference to the expressions vector.
Sourcepub fn mutate_block(&mut self) -> &mut Block
pub fn mutate_block(&mut self) -> &mut Block
Returns a mutable reference to the block.
Sourcepub fn identifiers_len(&self) -> usize
pub fn identifiers_len(&self) -> usize
Returns the number of identifiers.
Sourcepub fn expressions_len(&self) -> usize
pub fn expressions_len(&self) -> usize
Returns the number of expressions.
Sourcepub fn clear_types(&mut self)
pub fn clear_types(&mut self)
Removes type annotations from all identifiers.
Sourcepub fn clear_comments(&mut self)
pub fn clear_comments(&mut self)
Clears all comments from the tokens in this node.
Sourcepub fn clear_whitespaces(&mut self)
pub fn clear_whitespaces(&mut self)
Clears all whitespaces information from the tokens in this node.
Sourcepub fn mutate_first_token(&mut self) -> &mut Token
pub fn mutate_first_token(&mut self) -> &mut Token
Returns a mutable reference to the first token for this statement, creating it if missing.
Sourcepub fn mutate_last_token(&mut self) -> &mut Token
pub fn mutate_last_token(&mut self) -> &mut Token
Returns a mutable reference to the last token for this statement, creating it if missing.
Trait Implementations§
Source§impl Clone for GenericForStatement
impl Clone for GenericForStatement
Source§fn clone(&self) -> GenericForStatement
fn clone(&self) -> GenericForStatement
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for GenericForStatement
impl Debug for GenericForStatement
Source§impl From<GenericForStatement> for Statement
impl From<GenericForStatement> for Statement
Source§fn from(generic_for: GenericForStatement) -> Statement
fn from(generic_for: GenericForStatement) -> Statement
Source§impl PartialEq for GenericForStatement
impl PartialEq for GenericForStatement
impl Eq for GenericForStatement
impl StructuralPartialEq for GenericForStatement
Auto Trait Implementations§
impl Freeze for GenericForStatement
impl RefUnwindSafe for GenericForStatement
impl Send for GenericForStatement
impl Sync for GenericForStatement
impl Unpin for GenericForStatement
impl UnwindSafe for GenericForStatement
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
Source§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more