pub struct Bindings { /* private fields */ }Implementations§
Source§impl Bindings
impl Bindings
pub fn new(binding: Binding) -> Self
pub fn empty() -> Self
Sourcepub fn atom(&mut self) -> AtomS
pub fn atom(&mut self) -> AtomS
Create an atom Takes the last added binding If it’s already an atom, return it, and pops it from the bindings. If it’s not atom, create a variable based on its name and return that as an atom.
Sourcepub fn expr(&self) -> ExprS
pub fn expr(&self) -> ExprS
Given bindings, return a let expression. This takes all the bindings and wraps it in a let expression.
pub fn atom_bindings(self) -> (AtomS, Self)
pub fn bind_expr(&self, variables: &mut Variables, expr: ExprS) -> Self
pub fn bind_expr_no_span(&self, variables: &mut Variables, expr: Expr) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Bindings
impl RefUnwindSafe for Bindings
impl Send for Bindings
impl Sync for Bindings
impl Unpin for Bindings
impl UnwindSafe for Bindings
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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