pub fn add_type(&self, type_: Type) -> Result<()> {
        let name = type_.name().ok_or(ErrorKind::Arg(
            "Tried to add a type with no name".to_string(),
        ))?;
        if !self.named_types.borrow().contains_key(name) {
            self.named_types.borrow_mut().insert(
                name.to_owned(),
                type_.clone(),
            );
            self.rebuild_predicate_cache()
        } else {
            bail!(ErrorKind::Type(format!("{} already registered", name)))
        }
    }
/// Registers a new type with the database.
/// This is unstable, and will likely need to be moved to the initialization
/// of the database object in order to allow reconnecting to an existing
/// database.
Registers a new type with the database.
This is unstable, and will likely need to be moved to the initialization
of the database object in order to allow reconnecting to an existing
database.
Registers a new type with the database . This is unstable and will likely need to be moved to the initialization of the database object in order to allow reconnecting to an existing database .
pub fn add_type(&self, type_: Type) -> Result<()> {
        let name = type_.name().ok_or(ErrorKind::Arg(
            "Tried to add a type with no name".to_string(),
        ))?;
        if !self.named_types.borrow().contains_key(name) {
            self.named_types.borrow_mut().insert(
                name.to_owned(),
                type_.clone(),
            );
            self.rebuild_predicate_cache()
        } else {
            bail!(ErrorKind::Type(format!("{} already registered", name)))
        }
    }
pub fn add_type ( & self , type_ : Type ) -> Result < ( ) > { let name = type_ . name ( ) . ok_or ( ErrorKind :: Arg ( " " . to_string ( ) , ) ) ? ; if ! self . named_types . borrow ( ) . contains_key ( name ) { self . named_types . borrow_mut ( ) . insert ( name . to_owned ( ) , type_ . clone ( ) , ) ; self . rebuild_predicate_cache ( ) } else { bail ! ( ErrorKind Type ( format ( " " name ) ) ) } }
Registers a new type with the database.
Registers a new type with the database .
&self
type_
Type
&self
type_
Type