Trait ComponentControllerClientHandler

Source
pub trait ComponentControllerClientHandler<___T: Transport> {
    // Required methods
    fn on_publish_diagnostics(
        &mut self,
        sender: &ClientSender<___T, ComponentController>,
        message: ResponseBuffer<___T, OnPublishDiagnostics>,
    );
    fn on_escrow(
        &mut self,
        sender: &ClientSender<___T, ComponentController>,
        message: ResponseBuffer<___T, OnEscrow>,
    );
    fn on_stop(
        &mut self,
        sender: &ClientSender<___T, ComponentController>,
        message: ResponseBuffer<___T, OnStop>,
    );

    // Provided method
    fn on_unknown_interaction(
        &mut self,
        sender: &ClientSender<___T, ComponentController>,
        ordinal: u64,
    ) { ... }
}
Expand description

A client handler for the ComponentController protocol.

See ComponentController for more details.

Required Methods§

Source

fn on_publish_diagnostics( &mut self, sender: &ClientSender<___T, ComponentController>, message: ResponseBuffer<___T, OnPublishDiagnostics>, )

Event for runners to publish diagnostics to the platform.

This event signals to the platform that the runner for this component is publishing diagnostics about the runtime of the component. The component manager may optionally expose this data to clients.

Source

fn on_escrow( &mut self, sender: &ClientSender<___T, ComponentController>, message: ResponseBuffer<___T, OnEscrow>, )

Store some of the component’s state in the framework, to be redelivered to the component the next time it’s started (a practice called “escrowing”).

When the framework receives this event, it will wait until the current execution of the component has finished, then start the component again when the ZX_CHANNEL_READABLE signal is observed on outgoing_dir.

Repeated calls will replace the old escrowed value. This is discouraged.

Handles escrowed via OnEscrow are always delivered to the next execution of the component.

Source

fn on_stop( &mut self, sender: &ClientSender<___T, ComponentController>, message: ResponseBuffer<___T, OnStop>, )

Report that the component has stopped, with data about its termination. This will cause the component to make a lifecycle transition to Stopped.

Once the runner has sent OnStop it is free to close this ComponentRunner; the component framework will close its end of the channel when it receives this event.

Alternatively, a runner may close the controller channel without this event to signal component stop, but this method is legacy and no longer recommended.

Provided Methods§

Source

fn on_unknown_interaction( &mut self, sender: &ClientSender<___T, ComponentController>, ordinal: u64, )

Implementors§