pub trait AppAssistant {
// Required method
fn setup(&mut self) -> Result<(), Error>;
// Provided methods
fn create_view_assistant(
&mut self,
_: ViewKey,
) -> Result<ViewAssistantPtr, Error> { ... }
fn create_view_assistant_with_parameters(
&mut self,
params: ViewCreationParameters,
) -> Result<ViewAssistantPtr, Error> { ... }
fn outgoing_services_names(&self) -> Vec<&'static str> { ... }
fn handle_service_connection_request(
&mut self,
_service_name: &str,
_channel: Channel,
) -> Result<(), Error> { ... }
fn filter_config(&mut self, _config: &mut Config) { ... }
fn handle_message(&mut self, message: Message) { ... }
}
Expand description
Trait that a mod author must implement. Currently responsible for creating a view assistant when the Fuchsia view framework requests that the mod create a view.
Required Methods§
Sourcefn setup(&mut self) -> Result<(), Error>
fn setup(&mut self) -> Result<(), Error>
This method is responsible for setting up the AppAssistant implementation.
It’s not clear if this is going to so useful, as anything that isn’t
initialized in the creation of the structure implementing AppAssistant
is going to have to be represented as an Option
, which is awkward.
Provided Methods§
Sourcefn create_view_assistant(
&mut self,
_: ViewKey,
) -> Result<ViewAssistantPtr, Error>
fn create_view_assistant( &mut self, _: ViewKey, ) -> Result<ViewAssistantPtr, Error>
Called when the Fuchsia view system requests that a view be created, or once at startup when running without Scenic.
Sourcefn create_view_assistant_with_parameters(
&mut self,
params: ViewCreationParameters,
) -> Result<ViewAssistantPtr, Error>
fn create_view_assistant_with_parameters( &mut self, params: ViewCreationParameters, ) -> Result<ViewAssistantPtr, Error>
Called when the Fuchsia view system requests that a view be created. Provides parameters to view creation that include anything provided the the view creation requestor and an AppSender.
Sourcefn outgoing_services_names(&self) -> Vec<&'static str>
fn outgoing_services_names(&self) -> Vec<&'static str>
Return the list of names of services this app wants to provide
Sourcefn handle_service_connection_request(
&mut self,
_service_name: &str,
_channel: Channel,
) -> Result<(), Error>
fn handle_service_connection_request( &mut self, _service_name: &str, _channel: Channel, ) -> Result<(), Error>
Handle a request to connect to a service provided by this app
Sourcefn filter_config(&mut self, _config: &mut Config)
fn filter_config(&mut self, _config: &mut Config)
Filter Carnelian configuration at runtime, if needed.
Sourcefn handle_message(&mut self, message: Message)
fn handle_message(&mut self, message: Message)
This method is called when App::queue_message
is called with Application
as target.