pub(crate) fn create_prototype(&mut self, proto: Prototype) -> Result<Opr24, ErrorKind> {
      let slot = if let Some(slot) = self.free_prototypes.pop() {
         self.prototypes[u32::from(slot) as usize] = Some(proto);
         slot
      } else {
         let slot = Opr24::try_from(self.prototypes.len()).map_err(|_| ErrorKind::TooManyImpls)?;
         self.prototypes.push(Some(proto));
         slot
      };
      Ok(slot)
   }
/// Creates a prototype and returns its ID.
Creates a prototype and returns its ID.
Creates a prototype and returns its ID .
pub(crate) fn create_prototype(&mut self, proto: Prototype) -> Result<Opr24, ErrorKind> {
      let slot = if let Some(slot) = self.free_prototypes.pop() {
         self.prototypes[u32::from(slot) as usize] = Some(proto);
         slot
      } else {
         let slot = Opr24::try_from(self.prototypes.len()).map_err(|_| ErrorKind::TooManyImpls)?;
         self.prototypes.push(Some(proto));
         slot
      };
      Ok(slot)
   }
pub ( crate ) fn create_prototype ( & mut self , proto : Prototype ) -> Result < Opr24 , ErrorKind > { let slot = if let Some ( slot ) = self . free_prototypes . pop ( ) { self . prototypes [ u32 :: from ( slot ) as usize ] = Some ( proto ) ; slot } else { let slot = Opr24 :: try_from ( self . prototypes . len ( ) ) . map_err ( | _ | ErrorKind :: TooManyImpls ) ? ; self . prototypes . push ( Some ( proto ) ) ; slot } ; Ok ( slot ) }
Creates a prototype and returns its ID.
Creates a prototype and returns its ID .
&mut self
proto
Prototype