pub struct RealmInstance {
pub root: ScopedInstance,
/* private fields */
}
Expand description
A running instance of a created realm. When this struct is dropped the realm is destroyed, along with any components that were in the realm.
Fields§
§root: ScopedInstance
The root component of this realm instance, which can be used to access exposed capabilities from the realm.
Implementations§
Source§impl RealmInstance
impl RealmInstance
Sourcepub async fn destroy(self) -> Result<(), Error>
pub async fn destroy(self) -> Result<(), Error>
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.
Sourcepub async fn start_component_tree(&self) -> Result<(), Error>
pub async fn start_component_tree(&self) -> Result<(), Error>
Connects to the fuchsia.sys2.LifecycleController
protocol exposed by a nested
component manager and attempts to start the root component. This should only be used
when a realm is built in a nested component manager in debug mode.
Trait Implementations§
Source§impl Drop for RealmInstance
impl Drop for RealmInstance
Source§fn drop(&mut self)
fn drop(&mut self)
To ensure local components are shutdown in an orderly manner (i.e. after their dependent
clients) upon drop
, keep the local_component_runner_task alive in an async task until the
destroy_waiter synchronously destroys the realm.
Remember that you must keep a life reference to a RealmInstance
to ensure that your
realm stays running.
Auto Trait Implementations§
impl Freeze for RealmInstance
impl !RefUnwindSafe for RealmInstance
impl Send for RealmInstance
impl Sync for RealmInstance
impl Unpin for RealmInstance
impl !UnwindSafe for RealmInstance
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> IntoAny for T
impl<T> IntoAny for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more