pub async fn resolve_decl(realm: &Arc<Self>) -> Result<(), ModelError> {
        // Call `resolve()` outside of lock.
        let is_resolved = { realm.lock_state().await.is_some() };
        if !is_resolved {
            let component = realm.resolver_registry.resolve(&realm.component_url).await?;
            let decl: ComponentDecl = component
                .decl
                .unwrap()
                .try_into()
                .map_err(|e| ModelError::manifest_invalid(realm.component_url.clone(), e))?;
            {
                let mut state = realm.lock_state().await;
                if state.is_none() {
                    *state = Some(RealmState::new(realm, &decl).await?);
                }
            }
            let event =
                Event::new(realm.abs_moniker.clone(), EventPayload::ResolveInstance { decl });
            realm.hooks.dispatch(&event).await?;
        }
        Ok(())
    }
/// Resolves and populates the component declaration of this realm's Instance, if not already
/// populated.
Resolves and populates the component declaration of this realm's Instance, if not already
populated.
Resolves and populates the component declaration of this realm ' s Instance if not already populated .
pub async fn resolve_decl(realm: &Arc<Self>) -> Result<(), ModelError> {
        // Call `resolve()` outside of lock.
        let is_resolved = { realm.lock_state().await.is_some() };
        if !is_resolved {
            let component = realm.resolver_registry.resolve(&realm.component_url).await?;
            let decl: ComponentDecl = component
                .decl
                .unwrap()
                .try_into()
                .map_err(|e| ModelError::manifest_invalid(realm.component_url.clone(), e))?;
            {
                let mut state = realm.lock_state().await;
                if state.is_none() {
                    *state = Some(RealmState::new(realm, &decl).await?);
                }
            }
            let event =
                Event::new(realm.abs_moniker.clone(), EventPayload::ResolveInstance { decl });
            realm.hooks.dispatch(&event).await?;
        }
        Ok(())
    }
pub async fn resolve_decl ( realm : & Arc < Self > ) -> Result < ( ) , ModelError > { // Call `resolve()` outside of lock. let is_resolved = { realm . lock_state ( ) . await . is_some ( ) } ; if ! is_resolved { let component = realm . resolver_registry . resolve ( & realm . component_url ) . await ? ; let decl : ComponentDecl = component . decl . unwrap ( ) . try_into ( ) . map_err ( | e | ModelError :: manifest_invalid ( realm . component_url . clone ( ) , e ) ) ? ; { let mut state = realm . lock_state ( ) . await ; if state . is_none ( ) { * state = Some ( RealmState :: new ( realm , & decl ) . await ? ) ; } } let event = Event :: new ( realm . abs_moniker . clone ( ) , EventPayload :: ResolveInstance { decl } ) ; realm . hooks . dispatch ( & event ) . await ? ; } Ok ( ( ) ) }
Resolves and populates the component declaration of this realm's Instance, if not already
populated.
Resolves and populates the component declaration of this realm ' s Instance if not already populated .
realm
&Arc<Self>