pub async fn add_local_child<M>(
        &self,
        name: impl Into<String>,
        local_component_implementation: M,
        options: ChildOptions,
    ) -> Result<ChildRef, Error>
    where
        M: Fn(LocalComponentHandles) -> BoxFuture<'static, Result<(), anyhow::Error>>
            + Sync
            + Send
            + 'static,
    {
        let name: String = name.into();
        self.realm_proxy.add_local_child(&name, options.into()).await??;

        let mut child_path = self.realm_path.clone();
        child_path.push(name.clone());
        self.local_component_runner_builder
            .register_local_component(child_path.join("/"), local_component_implementation)
            .await?;

        Ok(ChildRef::new(name, self.realm_path.clone()))
    }
/// Adds a new local component to the realm
Adds a new local component to the realm
Adds a new local component to the realm
pub async fn add_local_child<M>(
        &self,
        name: impl Into<String>,
        local_component_implementation: M,
        options: ChildOptions,
    ) -> Result<ChildRef, Error>
    where
        M: Fn(LocalComponentHandles) -> BoxFuture<'static, Result<(), anyhow::Error>>
            + Sync
            + Send
            + 'static,
    {
        let name: String = name.into();
        self.realm_proxy.add_local_child(&name, options.into()).await??;
        let mut child_path = self.realm_path.clone();
        child_path.push(name.clone());
        self.local_component_runner_builder
            .register_local_component(child_path.join("/"), local_component_implementation)
            .await?;
        Ok(ChildRef::new(name, self.realm_path.clone()))
    }
pub async fn add_local_child < M > ( & self , name : impl Into < String > , local_component_implementation : M , options : ChildOptions , ) -> Result < ChildRef , Error > where M : Fn ( LocalComponentHandles ) -> BoxFuture < ' static , Result < ( ) , anyhow :: Error > > + Sync + Send + ' static , { let name : String = name . into ( ) ; self . realm_proxy . add_local_child ( & name , options . into ( ) ) . await ? ? ; let mut child_path = self . realm_path . clone ( ) ; child_path . push ( name . clone ( ) ) ; self . local_component_runner_builder . register_local_component ( child_path . join ( " " ) , local_component_implementation ) . await ? ; Ok ( ChildRef :: new ( name , self . realm_path . clone ( ) ) ) }
Adds a new local component to the realm
Adds a new local component to the realm
&self
name
impl Into<String>
local_component_implementation
M
options
ChildOptions
&self
name
impl Into<String>
local_component_implementation
M
options
ChildOptions