fn validate_child_ref(&mut self, decl: &str, field_name: &str, child: &fsys::ChildRef) -> bool {
        // Ensure the name is valid, and the reference refers to a static child.
        //
        // We attempt to list all errors if possible.
        let mut valid = true;
        if !check_name(
            Some(&child.name),
            decl,
            &format!("{}.child.name", field_name),
            &mut self.errors,
        ) {
            valid = false;
        }
        if child.collection.is_some() {
            self.errors
                .push(Error::extraneous_field(decl, format!("{}.child.collection", field_name)));
            valid = false;
        }
        if !valid {
            return false;
        }

        // Ensure the child exists.
        let name: &str = &child.name;
        if !self.all_children.contains(name) {
            self.errors.push(Error::invalid_child(decl, field_name, name));
            return false;
        }

        true
    }
/// Check a `ChildRef` contains a valid child that exists.
///
/// We ensure the target child is statically defined (i.e., not a dynamic child inside
/// a collection).
Check a `ChildRef` contains a valid child that exists.
We ensure the target child is statically defined .
Check a ` ChildRef ` contains a valid child that exists . We ensure the target child is statically defined .
fn validate_child_ref(&mut self, decl: &str, field_name: &str, child: &fsys::ChildRef) -> bool {
        // Ensure the name is valid, and the reference refers to a static child.
        //
        // We attempt to list all errors if possible.
        let mut valid = true;
        if !check_name(
            Some(&child.name),
            decl,
            &format!("{}.child.name", field_name),
            &mut self.errors,
        ) {
            valid = false;
        }
        if child.collection.is_some() {
            self.errors
                .push(Error::extraneous_field(decl, format!("{}.child.collection", field_name)));
            valid = false;
        }
        if !valid {
            return false;
        }
        // Ensure the child exists.
        let name: &str = &child.name;
        if !self.all_children.contains(name) {
            self.errors.push(Error::invalid_child(decl, field_name, name));
            return false;
        }
        true
    }
fn validate_child_ref ( & mut self , decl : & str , field_name : & str , child : & fsys :: ChildRef ) -> bool { // Ensure the name is valid, and the reference refers to a static child. // // We attempt to list all errors if possible. let mut valid = true ; if ! check_name ( Some ( & child . name ) , decl , & format ! ( " " field_name ) , & mut self . errors , ) { valid = false ; } if child . collection . is_some ( ) { self . errors . push ( Error :: extraneous_field ( decl , format ! ( " " field_name ) ) ) ; valid = false ; } if ! valid { return false ; } // Ensure the child exists. let name : & str = & child . name ; if ! self . all_children . contains ( name ) { self . errors . push ( Error :: invalid_child ( decl , field_name , name ) ) ; return false ; } true }
Check a `ChildRef` contains a valid child that exists.
Check a ` ChildRef ` contains a valid child that exists .
&mut self
decl
&str
field_name
&str
child
&fsys::ChildRef
&mut self
decl
&str
field_name
&str
child
&fsys::ChildRef