pub fn add_type<T>(&mut self, builder: TypeBuilder<T>) -> Result<(), Error>
   where
      T: Any + UserData,
   {
      let built = builder.build(&mut self.env, &mut self.gc)?;
      self.set_built_type(&built)?;
      Ok(())
   }
/// Declares a type in the global scope.
///
/// # Errors
///  - [`Error::TooManyGlobals`] - Too many globals with unique names were created
///  - [`Error::TooManyFunctions`] - Too many functions were registered into the engine
///  - [`Error::TooManyMethods`] - Too many unique method signatures were created
Declares a type in the global scope.
Declares a type in the global scope .
pub fn add_type<T>(&mut self, builder: TypeBuilder<T>) -> Result<(), Error>
   where
      T: Any + UserData,
   {
      let built = builder.build(&mut self.env, &mut self.gc)?;
      self.set_built_type(&built)?;
      Ok(())
   }
pub fn add_type < T > ( & mut self , builder : TypeBuilder < T > ) -> Result < ( ) , Error > where T : Any + UserData , { let built = builder . build ( & mut self . env , & mut self . gc ) ? ; self . set_built_type ( & built ) ? ; Ok ( ( ) ) }
Declares a type in the global scope.
Declares a type in the global scope .
&mut self
builder
TypeBuilder<T>
errors
[`Error::TooManyGlobals`] - Too many globals with unique names were created
[`Error::TooManyFunctions`] - Too many functions were registered into the engine
[`Error::TooManyMethods`] - Too many unique method signatures were created
[ ` Error :: TooManyGlobals ` ] - Too many globals with unique names were created [ ` Error :: TooManyFunctions ` ] - Too many functions were registered into the engine [ ` Error :: TooManyMethods ` ] - Too many unique method signatures were created