Trait ComponentControllerServerSender

Source
pub trait ComponentControllerServerSender {
    type Transport: Transport;

    // Required methods
    fn on_publish_diagnostics<___R>(
        &self,
        request: &mut ___R,
    ) -> Result<SendFuture<'_, Self::Transport>, EncodeError>
       where ___R: Encode<<Self::Transport as Transport>::SendBuffer, Encoded = <OnPublishDiagnostics as Method>::Response>;
    fn on_escrow<___R>(
        &self,
        request: &mut ___R,
    ) -> Result<SendFuture<'_, Self::Transport>, EncodeError>
       where ___R: Encode<<Self::Transport as Transport>::SendBuffer, Encoded = <OnEscrow as Method>::Response>;
    fn on_stop<___R>(
        &self,
        request: &mut ___R,
    ) -> Result<SendFuture<'_, Self::Transport>, EncodeError>
       where ___R: Encode<<Self::Transport as Transport>::SendBuffer, Encoded = <OnStop as Method>::Response>;
}
Expand description

A helper trait for the ComponentController server sender.

Required Associated Types§

Source

type Transport: Transport

Required Methods§

Source

fn on_publish_diagnostics<___R>( &self, request: &mut ___R, ) -> Result<SendFuture<'_, Self::Transport>, EncodeError>
where ___R: Encode<<Self::Transport as Transport>::SendBuffer, Encoded = <OnPublishDiagnostics as Method>::Response>,

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<___R>( &self, request: &mut ___R, ) -> Result<SendFuture<'_, Self::Transport>, EncodeError>
where ___R: Encode<<Self::Transport as Transport>::SendBuffer, Encoded = <OnEscrow as Method>::Response>,

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<___R>( &self, request: &mut ___R, ) -> Result<SendFuture<'_, Self::Transport>, EncodeError>
where ___R: Encode<<Self::Transport as Transport>::SendBuffer, Encoded = <OnStop as Method>::Response>,

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<___T> ComponentControllerServerSender for ServerSender<___T, ComponentController>
where ___T: Transport,

Source§

fn on_publish_diagnostics<___R>( &self, request: &mut ___R, ) -> Result<SendFuture<'_, Self::Transport>, EncodeError>
where ___R: Encode<<Self::Transport as Transport>::SendBuffer, Encoded = <OnPublishDiagnostics as Method>::Response>,

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<___R>( &self, request: &mut ___R, ) -> Result<SendFuture<'_, Self::Transport>, EncodeError>
where ___R: Encode<<Self::Transport as Transport>::SendBuffer, Encoded = <OnEscrow as Method>::Response>,

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<___R>( &self, request: &mut ___R, ) -> Result<SendFuture<'_, Self::Transport>, EncodeError>
where ___R: Encode<<Self::Transport as Transport>::SendBuffer, Encoded = <OnStop as Method>::Response>,

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.

Source§

type Transport = ___T

Implementors§