pub enum RealmRequest {
OpenController {
child: ChildRef,
controller: ServerEnd<ControllerMarker>,
responder: RealmOpenControllerResponder,
},
OpenExposedDir {
child: ChildRef,
exposed_dir: ServerEnd<DirectoryMarker>,
responder: RealmOpenExposedDirResponder,
},
CreateChild {
collection: CollectionRef,
decl: Child,
args: CreateChildArgs,
responder: RealmCreateChildResponder,
},
DestroyChild {
child: ChildRef,
responder: RealmDestroyChildResponder,
},
ListChildren {
collection: CollectionRef,
iter: ServerEnd<ChildIteratorMarker>,
responder: RealmListChildrenResponder,
},
}
Expand description
A protocol used by a component instance to manage its own realm, such as for binding to its children.
Requests to this protocol are processed in the order they are received. Clients that wish to send requests in parallel should open multiple connections.
The component framework provides this service to components that use
fuchsia.component.Realm
.
Variants§
OpenController
Operate on a child component. See documentation for [Controller
].
Errors:
INVALID_ARGUMENTS
:child
is not a valid child reference.INSTANCE_NOT_FOUND
:child
does not exist.INSTANCE_DIED
: This realm no longer exists.
OpenExposedDir
Opens the exposed directory of a child component instance. When this
function successfully returns, exposed_dir
is bound to a directory
that contains the capabilities which the child exposed to its realm
via ComponentDecl.exposes
(specified via “expose” declarations in
the component’s manifest). The child component will not start as a
result of this call. Instead, starting will occur iff the parent binds
to one of the capabilities contained within exposed_dir
.
exposed_dir
is open as long as child
exists.
Errors:
INVALID_ARGUMENTS
:child
is not a valid child reference.INSTANCE_NOT_FOUND
:child
does not exist.INSTANCE_CANNOT_RESOLVE
:child
’s component declaration failed to resolve.INSTANCE_DIED
: This realm no longer exists.
CreateChild
Creates a child component instance dynamically. When this function returns successfully, the instance exists, but it may not be running.
The environment of the child instance is determined by the environment
of the collection. decl
must not set environment
.
If decl.startup == EAGER
, or collection.durability == SINGLE_RUN
,
[CreateChild] will start the component and return once the component is
started. Otherwise, [CreateChild] will return immediately after creating
the component and will not start or resolve it.
Errors:
INVALID_ARGUMENTS
:collection
is not a valid reference orchild
is not a valid declaration.COLLECTION_NOT_FOUND
:collection
does not exist.INSTANCE_ALREADY_EXISTS
:decl.name
already exists incollection
.INSTANCE_CANNOT_RESOLVE
:child
’s component declaration failed to resolve in aSingleRun
collection.NO_SPACE
: Could not allocate storage for the new instance.INSTANCE_DIED
: This realm no longer exists.
DestroyChild
Destroys a dynamically-created component instance. When this function returns, the instance is destroyed and has stopped running. However, cleanup of the component’s resources (such as its isolated storage) may happen in the background after this function returns.
Errors:
INVALID_ARGUMENTS
:child
is not a valid reference or does not refer to a dynamic instance.INSTANCE_NOT_FOUND
:child
does not exist.COLLECTION_NOT_FOUND
:collection
does not exist.INSTANCE_DIED
: This realm no longer exists.
ListChildren
Returns an iterator that lists all instances in a collection.
NOTE: The results are not guaranteed to be consistent. Instances may be created or destroyed while the iterator is live, but those changes won’t be observed by the iterator after this method returns.
Errors:
INVALID_ARGUMENTS
:collection
is not a valid reference oriter
does not haveZX_RIGHT_WAIT
.COLLECTION_NOT_FOUND
:collection
does not exist.INSTANCE_DIED
: This realm no longer exists.- If
iter
does not have standard channel rights, this function may returnACCESS_DENIED
or component manager may closeiter
.
Fields
collection: CollectionRef
iter: ServerEnd<ChildIteratorMarker>
responder: RealmListChildrenResponder
Implementations§
source§impl RealmRequest
impl RealmRequest
pub fn into_open_controller( self, ) -> Option<(ChildRef, ServerEnd<ControllerMarker>, RealmOpenControllerResponder)>
pub fn into_open_exposed_dir( self, ) -> Option<(ChildRef, ServerEnd<DirectoryMarker>, RealmOpenExposedDirResponder)>
pub fn into_create_child( self, ) -> Option<(CollectionRef, Child, CreateChildArgs, RealmCreateChildResponder)>
pub fn into_destroy_child( self, ) -> Option<(ChildRef, RealmDestroyChildResponder)>
pub fn into_list_children( self, ) -> Option<(CollectionRef, ServerEnd<ChildIteratorMarker>, RealmListChildrenResponder)>
sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL