pub enum Function<'c> {
Builtin {
name: Symbol<'c>,
function: BuiltinFunction,
},
Defun {
name: Symbol<'c>,
args: Value<'c>,
body: Value<'c>,
},
}Variants§
Implementations§
Source§impl<'c> Function<'c>
impl<'c> Function<'c>
pub fn is_builtin(&self) -> bool
pub fn is_defun(&self) -> bool
pub fn validate_args( &self, name: &Symbol<'c>, expected: &Value<'c>, received: &Value<'c>, ) -> Result<Zip<ValueIterator<'c>, ValueIterator<'c>>>
pub fn bind_args_to_local_context( &self, vm: UniquePointer<Context<'c>>, name: &Symbol<'c>, expected: &Value<'c>, received: &Value<'c>, ) -> Result<Vec<(Symbol<'c>, Value<'c>)>>
pub fn call( &self, vm: UniquePointer<Context<'c>>, list: Value<'c>, ) -> Result<Value<'c>>
Trait Implementations§
Auto Trait Implementations§
impl<'c> Freeze for Function<'c>
impl<'c> RefUnwindSafe for Function<'c>
impl<'c> !Send for Function<'c>
impl<'c> !Sync for Function<'c>
impl<'c> Unpin for Function<'c>
impl<'c> UnwindSafe for Function<'c>
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