pub struct collect_upvars;
Expand description
Lists the potential “upvars” (lifted environment) of a function
ⓘ
builtin! fn collect_upvars (ConValue::Function(f)) -> IResult<ConValue>
{
use crate::function::collect_upvars::collect_upvars; for (name, bind) in
collect_upvars(f.decl(), env)
{
match bind
{
Some(bind) =>println!("{name}: {bind}"), None =>
println!("{name}: _"),
}
} Ok(ConValue::Empty)
}
Trait Implementations§
Source§impl BuiltIn for collect_upvars
impl BuiltIn for collect_upvars
fn description(&self) -> &str
Source§impl Callable for collect_upvars
impl Callable for collect_upvars
Source§fn call(&self, env: &mut Environment, args: &[ConValue]) -> IResult<ConValue>
fn call(&self, env: &mut Environment, args: &[ConValue]) -> IResult<ConValue>
Calls this Callable in the provided Environment, with ConValue args
The Callable is responsible for checking the argument count and validating types
The Callable is responsible for checking the argument count and validating types
Source§impl Clone for collect_upvars
impl Clone for collect_upvars
Source§fn clone(&self) -> collect_upvars
fn clone(&self) -> collect_upvars
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for collect_upvars
impl RefUnwindSafe for collect_upvars
impl Send for collect_upvars
impl Sync for collect_upvars
impl Unpin for collect_upvars
impl UnwindSafe for collect_upvars
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