/// Adds the collection `C` and its views.
Adds the collection `C` and its views.
Adds the collection ` C ` and its views .
pub fn define_collection<C: Collection + 'static>(&mut self) -> Result<(), Error> {
        let name = C::collection_name()?;
        if self.contained_collections.contains(&name) {
            Err(Error::CollectionAlreadyDefined)
        } else {
            self.collections_by_type_id
                .insert(TypeId::of::<C>(), name.clone());
            if let Some(key) = C::encryption_key() {
                self.collection_encryption_keys.insert(name.clone(), key);
            }
            self.contained_collections.insert(name);
            C::define_views(self)
        }
    }
pub fn define_collection < C : Collection + ' static > ( & mut self ) -> Result < ( ) , Error > { let name = C :: collection_name ( ) ? ; if self . contained_collections . contains ( & name ) { Err ( Error :: CollectionAlreadyDefined ) } else { self . collections_by_type_id . insert ( TypeId :: of :: < C > ( ) , name . clone ( ) ) ; if let Some ( key ) = C :: encryption_key ( ) { self . collection_encryption_keys . insert ( name . clone ( ) , key ) ; } self . contained_collections . insert ( name ) ; C :: define_views ( self ) } }
Adds the collection `C` and its views.
Adds the collection ` C ` and its views .
&mut self