Struct evaltrees::ast::Decl [−][src]
pub struct Decl<Aux> { pub name: Symbol, pub args: Vec<Pattern<Aux>>, pub body: Expr<Aux>, pub aux: Aux, }
A function or value declaration.
Fields
name: Symbol
The name of the function or value.
args: Vec<Pattern<Aux>>
The arguments to the function. If empty, the decl is for a value.
body: Expr<Aux>
The body of the function, or the expression assigned to the value.
aux: Aux
Auxiliary data.
Methods
impl<Aux> Decl<Aux>
[src]
impl<Aux> Decl<Aux>
impl<Aux> Decl<Aux>
[src]
impl<Aux> Decl<Aux>
pub fn display_as<'a>(
&'a self,
style: PrintStyle
) -> impl 'a + Display
[src]
pub fn display_as<'a>(
&'a self,
style: PrintStyle
) -> impl 'a + Display
Returns a Display that follows the given print style.
impl<Aux> Decl<Aux>
[src]
impl<Aux> Decl<Aux>
pub fn aux_ref(&self) -> &Aux
[src]
pub fn aux_ref(&self) -> &Aux
Gets the auxiliary data as a reference.
pub fn freevars(&self) -> BTreeSet<Symbol>
[src]
pub fn freevars(&self) -> BTreeSet<Symbol>
Returns the free variables of a declaration.
pub fn map_aux<Aux2, F: Copy + Fn(Aux) -> Aux2>(self, f: F) -> Decl<Aux2>
[src]
pub fn map_aux<Aux2, F: Copy + Fn(Aux) -> Aux2>(self, f: F) -> Decl<Aux2>
Modifies the aux value, recursively.
impl<Aux: Clone> Decl<Aux>
[src]
impl<Aux: Clone> Decl<Aux>
Trait Implementations
impl<Aux> Display for Decl<Aux>
[src]
impl<Aux> Display for Decl<Aux>
fn fmt(&self, fmt: &mut Formatter) -> FmtResult
[src]
fn fmt(&self, fmt: &mut Formatter) -> FmtResult
Formats the value using the given formatter. Read more
impl<Aux: Clone> Clone for Decl<Aux>
[src]
impl<Aux: Clone> Clone for Decl<Aux>
fn clone(&self) -> Decl<Aux>
[src]
fn clone(&self) -> Decl<Aux>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<Aux: Debug> Debug for Decl<Aux>
[src]
impl<Aux: Debug> Debug for Decl<Aux>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<Aux: PartialEq> PartialEq for Decl<Aux>
[src]
impl<Aux: PartialEq> PartialEq for Decl<Aux>