Skip to main content

WhileElseDesugar

Struct WhileElseDesugar 

Source
pub struct WhileElseDesugar;
Expand description

Desugars while-else expressions into loop-if-else-break expressions

Trait Implementations§

Source§

impl<A: AstTypes> Fold<A> for WhileElseDesugar

Source§

type Error = ()

Source§

fn fold_annotation( &mut self, anno: <A as AstTypes>::Annotation, ) -> Result<<A as AstTypes>::Annotation, Self::Error>

Consumes an Annotation in A, possibly transforms it, and produces a replacement Annotation in B
Source§

fn fold_macro_id( &mut self, name: <A as AstTypes>::MacroId, ) -> Result<<A as AstTypes>::MacroId, Self::Error>

Consumes a MacroId in A, possibly transforms it, and produces a replacement MacroId in B
Source§

fn fold_symbol( &mut self, name: <A as AstTypes>::Symbol, ) -> Result<<A as AstTypes>::Symbol, Self::Error>

Consumes a Symbol in A, possibly transforms it, and produces a replacement Symbol in B
Source§

fn fold_path( &mut self, path: <A as AstTypes>::Path, ) -> Result<<A as AstTypes>::Path, Self::Error>

Consumes a Path in A, possibly transforms it, and produces a replacement Path in B
Source§

fn fold_literal( &mut self, lit: <A as AstTypes>::Literal, ) -> Result<<A as AstTypes>::Literal, Self::Error>

Consumes a Literal in A, possibly transforms it, and produces a replacement Literal in B
Source§

fn fold_at_expr( &mut self, expr: At<Expr<A>, A>, ) -> Result<At<Expr<A>, A>, Self::Error>

Folds an annotated expression, so the expression and annotation can be seen at once.
Source§

fn fold_expr(&mut self, expr: Expr<From>) -> Result<Expr<To>, Self::Error>

Consumes an Expr, possibly transforms it, and produces a replacement Expr
Source§

fn fold_use(&mut self, item: Use<From>) -> Result<Use<To>, Self::Error>

Consumes a Use, possibly transforms it, and produces a replacement Use
Source§

fn fold_at_pat( &mut self, pat: At<Pat<From>, From>, ) -> Result<At<Pat<To>, To>, Self::Error>

Folds an annotated pattern, so the pattern and annotation can be seen at once.
Source§

fn fold_pat(&mut self, pat: Pat<From>) -> Result<Pat<To>, Self::Error>

Consumes a Pat, possibly transforms it, and produces a replacement Pat
Source§

fn fold_bind(&mut self, bind: Bind<From>) -> Result<Bind<To>, Self::Error>

Consumes a Bind, possibly transforms it, and produces a replacement Bind
Source§

fn fold_make(&mut self, make: Make<From>) -> Result<Make<To>, Self::Error>

Consumes a Make, possibly transforms it, and produces a replacement Make
Source§

fn fold_makearm( &mut self, arm: MakeArm<From>, ) -> Result<MakeArm<To>, Self::Error>

Consumes a MakeArm, possibly transforms it, and produces a replacement MakeArm
Source§

fn fold_match(&mut self, mtch: Match<From>) -> Result<Match<To>, Self::Error>

Consumes a Make, possibly transforms it, and produces a replacement Make
Source§

fn fold_matcharm( &mut self, arm: MatchArm<From>, ) -> Result<MatchArm<To>, Self::Error>

Consumes a MakeArm, possibly transforms it, and produces a replacement MakeArm

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.