[−][src]Struct rune::ast::ExprFor
A for
loop over an iterator: for i in [1, 2, 3] {}
.
Examples
use rune::{testing, ast}; testing::roundtrip::<ast::ExprFor>("for i in x {}"); testing::roundtrip::<ast::ExprFor>("for (a, _) in x {}"); testing::roundtrip::<ast::ExprFor>("'label: for i in x {}"); testing::roundtrip::<ast::ExprFor>("#[attr] 'label: for i in x {}");
Fields
attributes: Vec<Attribute>
The attributes of the for
loop
label: Option<(Label, Colon)>
The label of the loop.
for_token: For
The for
keyword.
binding: Pat
The pattern binding to use. Non-trivial pattern bindings will panic if the value doesn't match.
in_: In
The in
keyword.
iter: Expr
Expression producing the iterator.
body: Box<Block>
The body of the loop.
Trait Implementations
impl Clone for ExprFor
[src]
impl Debug for ExprFor
[src]
impl Eq for ExprFor
[src]
impl Parse for ExprFor
[src]
pub fn parse(p: &mut Parser<'_>) -> Result<Self, ParseError>
[src]
impl PartialEq<ExprFor> for ExprFor
[src]
impl Spanned for ExprFor
[src]
impl StructuralEq for ExprFor
[src]
impl StructuralPartialEq for ExprFor
[src]
impl ToTokens for ExprFor
[src]
pub fn to_tokens(&self, context: &MacroContext, stream: &mut TokenStream)
[src]
Auto Trait Implementations
impl RefUnwindSafe for ExprFor
[src]
impl Send for ExprFor
[src]
impl Sync for ExprFor
[src]
impl Unpin for ExprFor
[src]
impl UnwindSafe for ExprFor
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,