/// Destroys the realm instance, returning only once realm destruction is complete.
///
/// This function can be useful to call when it's important to ensure a realm accessing a
/// global resource is stopped before proceeding, or to ensure that realm destruction doesn't
/// race with process (and thus local component implementations) termination.
Destroys the realm instance, returning only once realm destruction is complete.
This function can be useful to call when it's important to ensure a realm accessing a
global resource is stopped before proceeding, or to ensure that realm destruction doesn't
race with process (and thus local component implementations) termination.
Destroys the realm instance returning only once realm destruction is complete . This function can be useful to call when it ' s important to ensure a realm accessing a global resource is stopped before proceeding or to ensure that realm destruction doesn ' t race with process ( and thus local component implementations ) termination .
pub async fn destroy(mut self) -> Result<(), Error> {
        if self.root.destroy_waiter_taken() {
            return Err(Error::DestroyWaiterTaken);
        }
        let _local_component_runner_task = self.local_component_runner_task.take();
        let destroy_waiter = self.root.take_destroy_waiter();
        drop(self);
        destroy_waiter.await.map_err(Error::FailedToDestroyChild)?;
        Ok(())
    }
pub async fn destroy ( mut self ) -> Result < ( ) , Error > { if self . root . destroy_waiter_taken ( ) { return Err ( Error :: DestroyWaiterTaken ) ; } let _local_component_runner_task = self . local_component_runner_task . take ( ) ; let destroy_waiter = self . root . take_destroy_waiter ( ) ; drop ( self ) ; destroy_waiter . await . map_err ( Error :: FailedToDestroyChild ) ? ; Ok ( ( ) ) }
Destroys the realm instance, returning only once realm destruction is complete.
Destroys the realm instance returning only once realm destruction is complete .
mut self