pub struct InputPipelineAssembly { /* private fields */ }
Expand description
An input pipeline assembly.
Represents a partial stage of the input pipeline which accepts inputs through an asynchronous sender channel, and emits outputs through an asynchronous receiver channel. Use [new] to create a new assembly. Use [add_handler], or [add_all_handlers] to add the input pipeline handlers to use. When done, InputPipeline::new can be used to make a new input pipeline.
§Implementation notes
Internally, when a new InputPipelineAssembly is created with multiple [InputHandler]s, the handlers are connected together using async queues. This allows fully streamed processing of input events, and also allows some pipeline stages to generate events spontaneously, i.e. without an external stimulus.
Implementations§
source§impl InputPipelineAssembly
impl InputPipelineAssembly
sourcepub fn new(metrics_logger: MetricsLogger) -> Self
pub fn new(metrics_logger: MetricsLogger) -> Self
Create a new but empty InputPipelineAssembly. Use [add_handler] or similar to add new handlers to it.
sourcepub fn add_handler(self, handler: Rc<dyn InputHandler>) -> Self
pub fn add_handler(self, handler: Rc<dyn InputHandler>) -> Self
Adds another input_handler::InputHandler into the InputPipelineAssembly. The handlers
are invoked in the order they are added, and successive handlers are glued together using
unbounded queues. Returns Self
for chaining.
sourcepub fn add_all_handlers(self, handlers: Vec<Rc<dyn InputHandler>>) -> Self
pub fn add_all_handlers(self, handlers: Vec<Rc<dyn InputHandler>>) -> Self
Adds all handlers into the assembly in the order they appear in handlers
.
sourcepub fn add_display_ownership(
self,
display_ownership_event: Event,
input_handlers_node: &Node
) -> InputPipelineAssembly
pub fn add_display_ownership( self, display_ownership_event: Event, input_handlers_node: &Node ) -> InputPipelineAssembly
Adds the DisplayOwnership to the input pipeline. The display_ownership_event
is
assumed to be the Scenic event used to report changes in display ownership, obtained
by fuchsia.ui.scenic/Scenic.GetDisplayOwnershipEvent
. This code has no way to check
whether that invariant is upheld, so this is something that the user will need to
ensure.
sourcepub fn add_autorepeater(self, input_handlers_node: &Node) -> Self
pub fn add_autorepeater(self, input_handlers_node: &Node) -> Self
Adds the autorepeater into the input pipeline assembly. The autorepeater is installed after any handlers that have been already added to the assembly.
sourcepub fn add_focus_listener(
self,
focus_chain_publisher: FocusChainProviderPublisher
) -> Self
pub fn add_focus_listener( self, focus_chain_publisher: FocusChainProviderPublisher ) -> Self
Adds a focus listener task into the input pipeline assembly. The focus
listener forwards focus chain changes to
fuchsia.ui.keyboard.focus.Controller
and watchers of
fuchsia.ui.focus.FocusChainProvider
. It is required for the correct
operation of the implementors of those protocols, e.g. text_manager
.
§Arguments:
focus_chain_publisher
: to forward to other downstream watchers.
§Requires:
fuchsia.ui.views.FocusChainListenerRegistry
: to register for updates.fuchsia.ui.keyboard.focus.Controller
: to forward to text_manager.