pub struct ErasedLetChain {
pub bindings: Vec<(String, ErasedExprExt)>,
pub body: ErasedExprExt,
}Expand description
A chain of let-bindings produced by ANF conversion.
Fields§
§bindings: Vec<(String, ErasedExprExt)>The binding pairs: (name_hint, rhs).
body: ErasedExprExtThe final body after all bindings.
Implementations§
Source§impl ErasedLetChain
impl ErasedLetChain
Sourcepub fn new(body: ErasedExprExt) -> Self
pub fn new(body: ErasedExprExt) -> Self
Create an empty chain with the given body.
Sourcepub fn push(&mut self, name: impl Into<String>, rhs: ErasedExprExt)
pub fn push(&mut self, name: impl Into<String>, rhs: ErasedExprExt)
Push a new binding onto the chain (outermost = last).
Sourcepub fn into_expr(self) -> ErasedExprExt
pub fn into_expr(self) -> ErasedExprExt
Convert the chain back into nested ErasedExprExt::Let nodes.
Auto Trait Implementations§
impl Freeze for ErasedLetChain
impl RefUnwindSafe for ErasedLetChain
impl Send for ErasedLetChain
impl Sync for ErasedLetChain
impl Unpin for ErasedLetChain
impl UnsafeUnpin for ErasedLetChain
impl UnwindSafe for ErasedLetChain
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
Mutably borrows from an owned value. Read more