pub fn raw_fn<F, N>(&mut self, name: N, f: F) -> Result<(), ContextError>
    where
        F: 'static + Copy + Fn(&mut Stack, usize) -> Result<(), VmError> + Send + Sync,
        N: IntoIterator,
        N::Item: IntoComponent,
    {
        let name = Item::with_item(name);

        if self.functions.contains_key(&name) {
            return Err(ContextError::ConflictingFunctionName { name });
        }

        self.functions.insert(
            name,
            ModuleFn {
                handler: Arc::new(move |stack, args| f(stack, args)),
                args: None,
            },
        );

        Ok(())
    }
/// Register a raw function which interacts directly with the virtual
/// machine.
Register a raw function which interacts directly with the virtual
machine.
Register a raw function which interacts directly with the virtual machine .
pub fn raw_fn<F, N>(&mut self, name: N, f: F) -> Result<(), ContextError>
    where
        F: 'static + Copy + Fn(&mut Stack, usize) -> Result<(), VmError> + Send + Sync,
        N: IntoIterator,
        N::Item: IntoComponent,
    {
        let name = Item::with_item(name);
        if self.functions.contains_key(&name) {
            return Err(ContextError::ConflictingFunctionName { name });
        }
        self.functions.insert(
            name,
            ModuleFn {
                handler: Arc::new(move |stack, args| f(stack, args)),
                args: None,
            },
        );
        Ok(())
    }
pub fn raw_fn < F , N > ( & mut self , name : N , f : F ) -> Result < ( ) , ContextError > where F : ' static + Copy + Fn ( & mut Stack , usize ) -> Result < ( ) , VmError > + Send + Sync , N : IntoIterator , N :: Item : IntoComponent , { let name = Item :: with_item ( name ) ; if self . functions . contains_key ( & name ) { return Err ( ContextError :: ConflictingFunctionName { name } ) ; } self . functions . insert ( name , ModuleFn { handler : Arc :: new ( move | stack , args | f ( stack , args ) ) , args : None , } , ) ; Ok ( ( ) ) }
Register a raw function which interacts directly with the virtual
machine.
Register a raw function which interacts directly with the virtual machine .
&mut self
name
N
f
F
&mut self
name
N
f
F