// Creates a new non-root component instance as a child of `parent`.
Creates a new non-root component instance as a child of `parent`.
Creates a new non - root component instance as a child of ` parent ` .
pub(crate) fn new_for_child(
        child: &Child,
        absolute_url: String,
        child_component_decl: ComponentDecl,
        parent: Arc<Self>,
        policy_checker: GlobalPolicyChecker,
        component_id_index: Arc<ComponentIdIndex>,
    ) -> Result<Arc<Self>, BuildAnalyzerModelError> {
        let environment = EnvironmentForAnalyzer::new_for_child(&parent, child)?;
        let instanced_moniker = parent.instanced_moniker.child(InstancedChildMoniker::new(
            child.child_moniker.name.clone(),
            child.child_moniker.collection.clone(),
            0,
        ));
        let abs_moniker = instanced_moniker.clone().to_absolute_moniker();
        Ok(Arc::new(Self {
            instanced_moniker,
            abs_moniker,
            decl: child_component_decl,
            url: absolute_url,
            parent: WeakExtendedInstanceInterface::from(&ExtendedInstanceInterface::Component(
                parent,
            )),
            children: RwLock::new(HashMap::new()),
            environment,
            policy_checker,
            component_id_index,
        }))
    }
pub ( crate ) fn new_for_child ( child : & Child , absolute_url : String , child_component_decl : ComponentDecl , parent : Arc < Self > , policy_checker : GlobalPolicyChecker , component_id_index : Arc < ComponentIdIndex > , ) -> Result < Arc < Self > , BuildAnalyzerModelError > { let environment = EnvironmentForAnalyzer :: new_for_child ( & parent , child ) ? ; let instanced_moniker = parent . instanced_moniker . child ( InstancedChildMoniker :: new ( child . child_moniker . name . clone ( ) , child . child_moniker . collection . clone ( ) , 0 , ) ) ; let abs_moniker = instanced_moniker . clone ( ) . to_absolute_moniker ( ) ; Ok ( Arc :: new ( Self { instanced_moniker , abs_moniker , decl : child_component_decl , url : absolute_url , parent : WeakExtendedInstanceInterface :: from ( & ExtendedInstanceInterface :: Component ( parent , ) ) , children : RwLock :: new ( HashMap :: new ( ) ) , environment , policy_checker , component_id_index , } ) ) }
Creates a new non-root component instance as a child of `parent`.
Creates a new non - root component instance as a child of ` parent ` .
child
&Child
absolute_url
String
child_component_decl
ComponentDecl
parent
Arc<Self>
policy_checker
GlobalPolicyChecker
component_id_index
Arc<ComponentIdIndex>