/// Check a `CollectionRef` is valid and refers to an existing collection.
Check a `CollectionRef` is valid and refers to an existing collection.
Check a ` CollectionRef ` is valid and refers to an existing collection .
fn validate_collection_ref(
        &mut self,
        decl: &str,
        field_name: &str,
        collection: &fsys::CollectionRef,
    ) -> bool {
        // Ensure the name is valid.
        if !check_name(
            Some(&collection.name),
            decl,
            &format!("{}.collection.name", field_name),
            &mut self.errors,
        ) {
            return false;
        }
        // Ensure the collection exists.
        if !self.all_collections.contains(&collection.name as &str) {
            self.errors.push(Error::invalid_collection(decl, field_name, &collection.name as &str));
            return false;
        }
        true
    }
fn validate_collection_ref ( & mut self , decl : & str , field_name : & str , collection : & fsys :: CollectionRef , ) -> bool { // Ensure the name is valid. if ! check_name ( Some ( & collection . name ) , decl , & format ! ( " " field_name ) , & mut self . errors , ) { return false ; } // Ensure the collection exists. if ! self . all_collections . contains ( & collection . name as & str ) { self . errors . push ( Error :: invalid_collection ( decl , field_name , & collection . name as & str ) ) ; return false ; } true }
Check a `CollectionRef` is valid and refers to an existing collection.
Check a ` CollectionRef ` is valid and refers to an existing collection .
&mut self
decl
&str
field_name
&str
collection
&fsys::CollectionRef