pub async fn start(
        &self,
        lattice_rpc: Option<Box<dyn LatticeProvider + 'static>>,
        lattice_control: Option<Box<dyn ControlPlaneProvider + 'static>>,
    ) -> Result<()> {
        let mb = MessageBus::from_registry();
        if let Some(l) = lattice_rpc {
            mb.send(SetProvider { provider: l }).await?;
        }
        // message bus authorizes invocations, host controller authorizes loads
        mb.send(SetAuthorizer {
            auth: self.authorizer.clone(),
        })
        .await?;

        let hc = HostController::from_registry();
        let hc2 = hc.clone();
        hc2.send(SetAuthorizer {
            auth: self.authorizer.clone(),
        })
        .await?;
        hc.send(SetLabels {
            labels: self.labels.clone(),
        })
        .await?;
        *self.id.borrow_mut() = hc.send(GetHostID {}).await?;

        // Start control plane
        if let Some(lattice_control) = lattice_control {
            let cp = ControlPlane::from_registry();
            cp.send(crate::control_plane::cpactor::Initialize {
                provider: lattice_control,
                control_options: ControlOptions {
                    host_labels: self.labels.clone(),
                    oci_allow_latest: self.allow_latest,
                    ..Default::default()
                },
            })
            .await?;
        }

        Ok(())
    }
/// Starts the host's actor system. This call is non-blocking, so it is up to the consumer
/// to provide some form of parking or waiting (e.g. wait for a Ctrl-C signal).
Starts the host's actor system. This call is non-blocking, so it is up to the consumer
to provide some form of parking or waiting .
Starts the host ' s actor system . This call is non - blocking so it is up to the consumer to provide some form of parking or waiting .
pub async fn start(
        &self,
        lattice_rpc: Option<Box<dyn LatticeProvider + 'static>>,
        lattice_control: Option<Box<dyn ControlPlaneProvider + 'static>>,
    ) -> Result<()> {
        let mb = MessageBus::from_registry();
        if let Some(l) = lattice_rpc {
            mb.send(SetProvider { provider: l }).await?;
        }
        // message bus authorizes invocations, host controller authorizes loads
        mb.send(SetAuthorizer {
            auth: self.authorizer.clone(),
        })
        .await?;
        let hc = HostController::from_registry();
        let hc2 = hc.clone();
        hc2.send(SetAuthorizer {
            auth: self.authorizer.clone(),
        })
        .await?;
        hc.send(SetLabels {
            labels: self.labels.clone(),
        })
        .await?;
        *self.id.borrow_mut() = hc.send(GetHostID {}).await?;
        // Start control plane
        if let Some(lattice_control) = lattice_control {
            let cp = ControlPlane::from_registry();
            cp.send(crate::control_plane::cpactor::Initialize {
                provider: lattice_control,
                control_options: ControlOptions {
                    host_labels: self.labels.clone(),
                    oci_allow_latest: self.allow_latest,
                    ..Default::default()
                },
            })
            .await?;
        }
        Ok(())
    }
pub async fn start ( & self , lattice_rpc : Option < Box < dyn LatticeProvider + ' static > > , lattice_control : Option < Box < dyn ControlPlaneProvider + ' static > > , ) -> Result < ( ) > { let mb = MessageBus :: from_registry ( ) ; if let Some ( l ) = lattice_rpc { mb . send ( SetProvider { provider : l } ) . await ? ; } // message bus authorizes invocations, host controller authorizes loads mb . send ( SetAuthorizer { auth : self . authorizer . clone ( ) , } ) . await ? ; let hc = HostController :: from_registry ( ) ; let hc2 = hc . clone ( ) ; hc2 . send ( SetAuthorizer { auth : self . authorizer . clone ( ) , } ) . await ? ; hc . send ( SetLabels { labels : self . labels . clone ( ) , } ) . await ? ; * self . id . borrow_mut ( ) = hc . send ( GetHostID { } ) . await ? ; // Start control plane if let Some ( lattice_control ) = lattice_control { let cp = ControlPlane :: from_registry ( ) ; cp . send ( crate :: control_plane :: cpactor :: Initialize { provider : lattice_control , control_options : ControlOptions { host_labels : self . labels . clone ( ) , oci_allow_latest : self . allow_latest , .. Default :: default ( ) } , } ) . await ? ; } Ok ( ( ) ) }
Starts the host's actor system.
Starts the host ' s actor system .
&self
lattice_rpc
Option<Box<dyn LatticeProvider + 'static>>
lattice_control
Option<Box<dyn ControlPlaneProvider + 'static>>
&self
lattice_rpc
Option<Box<dyn LatticeProvider + 'static>>
lattice_control
Option<Box<dyn ControlPlaneProvider + 'static>>