pub fn populate_decl(
        &mut self,
        decl: Option<fsys::ComponentDecl>,
        realm: &Realm,
    ) -> Result<(), ModelError> {
        if self.decl.is_none() {
            if decl.is_none() {
                return Err(ModelError::ComponentInvalid);
            }
            let decl = decl.unwrap().try_into().map_err(|e| {
                ModelError::manifest_invalid(realm.instance.component_url.clone(), e)
            })?;
            self.child_realms = Some(realm.make_child_realms(&decl));
            self.decl = Some(decl);
        }
        Ok(())
    }
/// Populates the component declaration of this realm's Instance with `decl`, if not already
/// populated. `url` should be the URL for this component, and is used in error generation.
Populates the component declaration of this realm's Instance with `decl`, if not already
populated. `url` should be the URL for this component, and is used in error generation.
Populates the component declaration of this realm ' s Instance with ` decl ` if not already populated . ` url ` should be the URL for this component and is used in error generation .
pub fn populate_decl(
        &mut self,
        decl: Option<fsys::ComponentDecl>,
        realm: &Realm,
    ) -> Result<(), ModelError> {
        if self.decl.is_none() {
            if decl.is_none() {
                return Err(ModelError::ComponentInvalid);
            }
            let decl = decl.unwrap().try_into().map_err(|e| {
                ModelError::manifest_invalid(realm.instance.component_url.clone(), e)
            })?;
            self.child_realms = Some(realm.make_child_realms(&decl));
            self.decl = Some(decl);
        }
        Ok(())
    }
pub fn populate_decl ( & mut self , decl : Option < fsys :: ComponentDecl > , realm : & Realm , ) -> Result < ( ) , ModelError > { if self . decl . is_none ( ) { if decl . is_none ( ) { return Err ( ModelError :: ComponentInvalid ) ; } let decl = decl . unwrap ( ) . try_into ( ) . map_err ( | e | { ModelError :: manifest_invalid ( realm . instance . component_url . clone ( ) , e ) } ) ? ; self . child_realms = Some ( realm . make_child_realms ( & decl ) ) ; self . decl = Some ( decl ) ; } Ok ( ( ) ) }
Populates the component declaration of this realm's Instance with `decl`, if not already
populated.
Populates the component declaration of this realm ' s Instance with ` decl ` if not already populated .
&mut self
decl
Option<fsys::ComponentDecl>
realm
&Realm
&mut self
decl
Option<fsys::ComponentDecl>
realm
&Realm