/// Given a `ComponentInstance` which has been bound, look up the resolved URL
/// and package into a `ComponentInfo` struct.
Given a `ComponentInstance` which has been bound, look up the resolved URL
and package into a `ComponentInfo` struct.
Given a ` ComponentInstance ` which has been bound look up the resolved URL and package into a ` ComponentInfo ` struct .
pub async fn new(component: Arc<ComponentInstance>) -> ComponentInfo {
        // The koid is the only unique piece of information we have about
        // a component start request. Two start requests for the same
        // component URL look identical to the Runner, the only difference
        // being the Channel passed to the Runner to use for the
        // ComponentController protocol.
        let koid = {
            let component = component.lock_execution().await;
            let runtime = component.runtime.as_ref().expect("runtime is unexpectedly missing");
            let controller =
                runtime.controller.as_ref().expect("controller is unexpectedly missing");
            let basic_info = controller
                .as_channel()
                .basic_info()
                .expect("error getting basic info about controller channel");
            // should be the koid of the other side of the channel
            basic_info.related_koid
        };
        ComponentInfo { component, channel_id: koid }
    }
pub async fn new ( component : Arc < ComponentInstance > ) -> ComponentInfo { // The koid is the only unique piece of information we have about // a component start request. Two start requests for the same // component URL look identical to the Runner, the only difference // being the Channel passed to the Runner to use for the // ComponentController protocol. let koid = { let component = component . lock_execution ( ) . await ; let runtime = component . runtime . as_ref ( ) . expect ( " " ) ; let controller = runtime . controller . as_ref ( ) . expect ( " " ) ; let basic_info = controller . as_channel ( ) . basic_info ( ) . expect ( " " ) ; // should be the koid of the other side of the channel basic_info . related_koid } ; ComponentInfo { component , channel_id : koid } }
Given a `ComponentInstance` which has been bound, look up the resolved URL
and package into a `ComponentInfo` struct.
Given a ` ComponentInstance ` which has been bound look up the resolved URL and package into a ` ComponentInfo ` struct .
component
Arc<ComponentInstance>