pub trait ControllerServerHandler<___T: Transport = Channel> {
// Required methods
fn start(
&mut self,
request: Request<Start, ___T>,
responder: Responder<Start, ___T>,
) -> impl Future<Output = ()> + Send;
fn is_started(
&mut self,
responder: Responder<IsStarted, ___T>,
) -> impl Future<Output = ()> + Send;
fn open_exposed_dir(
&mut self,
request: Request<OpenExposedDir, ___T>,
responder: Responder<OpenExposedDir, ___T>,
) -> impl Future<Output = ()> + Send;
fn get_exposed_dictionary(
&mut self,
responder: Responder<GetExposedDictionary, ___T>,
) -> impl Future<Output = ()> + Send;
fn destroy(
&mut self,
responder: Responder<Destroy, ___T>,
) -> impl Future<Output = ()> + Send;
// Provided method
fn on_unknown_interaction(
&mut self,
ordinal: u64,
) -> impl Future<Output = ()> + Send { ... }
}Expand description
A server handler for the Controller protocol.
See Controller for more details.
Required Methods§
Sourcefn start(
&mut self,
request: Request<Start, ___T>,
responder: Responder<Start, ___T>,
) -> impl Future<Output = ()> + Send
fn start( &mut self, request: Request<Start, ___T>, responder: Responder<Start, ___T>, ) -> impl Future<Output = ()> + Send
Start the component, optionally providing additional handles to be given to the component. Returns INSTANCE_ALREADY_RUNNING if the instance is currently running.
Sourcefn is_started(
&mut self,
responder: Responder<IsStarted, ___T>,
) -> impl Future<Output = ()> + Send
fn is_started( &mut self, responder: Responder<IsStarted, ___T>, ) -> impl Future<Output = ()> + Send
Returns true if this instance is currently running.
Sourcefn open_exposed_dir(
&mut self,
request: Request<OpenExposedDir, ___T>,
responder: Responder<OpenExposedDir, ___T>,
) -> impl Future<Output = ()> + Send
fn open_exposed_dir( &mut self, request: Request<OpenExposedDir, ___T>, responder: Responder<OpenExposedDir, ___T>, ) -> impl Future<Output = ()> + Send
Opens the exposed directory of the controlled component, through which
capabilities the component exposed via ComponentDecl.exposes are
available, on success.
Binding to the exposed directory requires that the component be resolved, but it will not be started until/unless some capability is requested that requires it to be.
If this component is destroyed, any outstanding connections to
exposed_dir will be closed.
Errors:
INSTANCE_CANNOT_RESOLVE: This component failed to resolve.
Sourcefn get_exposed_dictionary(
&mut self,
responder: Responder<GetExposedDictionary, ___T>,
) -> impl Future<Output = ()> + Send
fn get_exposed_dictionary( &mut self, responder: Responder<GetExposedDictionary, ___T>, ) -> impl Future<Output = ()> + Send
Returns the dictionary containing the component’s exposed capabilities.
Sourcefn destroy(
&mut self,
responder: Responder<Destroy, ___T>,
) -> impl Future<Output = ()> + Send
fn destroy( &mut self, responder: Responder<Destroy, ___T>, ) -> impl Future<Output = ()> + Send
Destroys this component. When this method returns, the component is either destroyed or in the case of an error no destruction happened.
Errors:
ACCESS_DENIED: Destruction of this component is not allowed. Currently, this can happen if the component is a static child of its parent.INTERNAL: Something prevented destruction from succeeding – component manager’s logs will contain more detail.
Provided Methods§
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.