pub fn add_function<F, V>(&mut self, name: &str, f: F) -> Result<(), Error>
   where
      V: ffvariants::Bare,
      F: ForeignFunction<V>,
   {
      self.add_raw_function(
         name,
         F::parameter_count(),
         FunctionKind::Foreign(f.into_raw_foreign_function()),
      )
   }
/// Declares a function in the global scope.
///
/// # Errors
/// See [`add_raw_function`][`Self::add_raw_function`].
Declares a function in the global scope.
Declares a function in the global scope .
pub fn add_function<F, V>(&mut self, name: &str, f: F) -> Result<(), Error>
   where
      V: ffvariants::Bare,
      F: ForeignFunction<V>,
   {
      self.add_raw_function(
         name,
         F::parameter_count(),
         FunctionKind::Foreign(f.into_raw_foreign_function()),
      )
   }
pub fn add_function < F , V > ( & mut self , name : & str , f : F ) -> Result < ( ) , Error > where V : ffvariants :: Bare , F : ForeignFunction < V > , { self . add_raw_function ( name , F :: parameter_count ( ) , FunctionKind :: Foreign ( f . into_raw_foreign_function ( ) ) , ) }
Declares a function in the global scope.
Declares a function in the global scope .
&mut self
name
&str
f
F
errors
None