pub trait ControllerServerHandler<___T: Transport> {
// Required methods
fn start(
&mut self,
sender: &ServerSender<Controller, ___T>,
request: Request<Start, ___T>,
responder: Responder<Start>,
) -> impl Future<Output = ()> + Send;
fn is_started(
&mut self,
sender: &ServerSender<Controller, ___T>,
responder: Responder<IsStarted>,
) -> impl Future<Output = ()> + Send;
fn get_exposed_dictionary(
&mut self,
sender: &ServerSender<Controller, ___T>,
responder: Responder<GetExposedDictionary>,
) -> impl Future<Output = ()> + Send;
fn destroy(
&mut self,
sender: &ServerSender<Controller, ___T>,
responder: Responder<Destroy>,
) -> impl Future<Output = ()> + Send;
// Provided method
fn on_unknown_interaction(
&mut self,
sender: &ServerSender<Controller, ___T>,
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,
sender: &ServerSender<Controller, ___T>,
request: Request<Start, ___T>,
responder: Responder<Start>,
) -> impl Future<Output = ()> + Send
fn start( &mut self, sender: &ServerSender<Controller, ___T>, request: Request<Start, ___T>, responder: Responder<Start>, ) -> 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,
sender: &ServerSender<Controller, ___T>,
responder: Responder<IsStarted>,
) -> impl Future<Output = ()> + Send
fn is_started( &mut self, sender: &ServerSender<Controller, ___T>, responder: Responder<IsStarted>, ) -> impl Future<Output = ()> + Send
Returns true if this instance is currently running.
Sourcefn get_exposed_dictionary(
&mut self,
sender: &ServerSender<Controller, ___T>,
responder: Responder<GetExposedDictionary>,
) -> impl Future<Output = ()> + Send
fn get_exposed_dictionary( &mut self, sender: &ServerSender<Controller, ___T>, responder: Responder<GetExposedDictionary>, ) -> impl Future<Output = ()> + Send
Returns the dictionary containing the component’s exposed capabilities.
Sourcefn destroy(
&mut self,
sender: &ServerSender<Controller, ___T>,
responder: Responder<Destroy>,
) -> impl Future<Output = ()> + Send
fn destroy( &mut self, sender: &ServerSender<Controller, ___T>, responder: Responder<Destroy>, ) -> impl Future<Output = ()> + Send
Destroys this component. When this method returns, either:
- Ok was returned, indicating destruction has begun.
- An error was returned, and destruction will not be attempted.
If Ok was returned, destruction will proceed in the background, but it hasn’t necessarily completed yet. When it completes, the framework will close this Controller channel.
Errors:
ACCESS_DENIED
: Destruction of this component is not allowed. Currently, this can happen if the component is a static child of its parent.
Provided Methods§
fn on_unknown_interaction( &mut self, sender: &ServerSender<Controller, ___T>, ordinal: u64, ) -> impl Future<Output = ()> + Send
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.