pub struct ComponentController { /* private fields */ }
Expand description
Wrapper around the ComponentControllerProxy
with utilities for handling events.
Implementations§
source§impl<'a> ComponentController
impl<'a> ComponentController
sourcepub fn new(proxy: ComponentControllerProxy) -> Self
pub fn new(proxy: ComponentControllerProxy) -> Self
Create a new wrapper around a ComponentControllerProxy
.
A task will be spawned to dispatch events on the ComponentControllerProxy
.
sourcepub fn wait_for_epitaph(&self) -> BoxFuture<'static, Status>
pub fn wait_for_epitaph(&self) -> BoxFuture<'static, Status>
Obtain a future for the epitaph value.
If the async task handling the ComponentControllerProxy
unexpectedly exits, the future
will resolve to PEER_CLOSED
. Otherwise, it will resolve to the zx::Status
representing
the epitaph sent on the channel.
This method may be called multiple times from multiple threads.
sourcepub fn take_diagnostics_receiver(
&mut self
) -> Option<Receiver<ComponentDiagnostics>>
pub fn take_diagnostics_receiver( &mut self ) -> Option<Receiver<ComponentDiagnostics>>
Obtain a receiver for the diagnostics values sent by the runner for the component.
This method may be called multiple times, but only the first call will obtain the value.
Methods from Deref<Target = ComponentControllerProxy>§
sourcepub fn take_event_stream(&self) -> ComponentControllerEventStream
pub fn take_event_stream(&self) -> ComponentControllerEventStream
Get a Stream of events from the remote end of the ComponentController protocol
Panics
Panics if the event stream was already taken.
sourcepub fn stop(&self) -> Result<(), Error>
pub fn stop(&self) -> Result<(), Error>
Request to stop the component instance.
After stopping the component instance, the server should close this connection with an epitaph. After the connection closes, component manager considers this component instance to be Stopped and the component’s namespace will be torn down.
sourcepub fn kill(&self) -> Result<(), Error>
pub fn kill(&self) -> Result<(), Error>
Stop this component instance immediately.
The ComponentRunner must immediately kill the component instance, and then close this connection with an epitaph. After the connection closes, component manager considers this component instance to be Stopped and the component’s namespace will be torn down.
In some cases Kill() may be issued before Stop(), but that is not guaranteed.