pub struct MouseInjectorHandler {
pub inspect_status: InputHandlerStatus,
/* private fields */
}Expand description
A MouseInjectorHandler parses mouse events and forwards them to Scenic through the
fidl_fuchsia_pointerinjector protocols.
Fields§
§inspect_status: InputHandlerStatusThe inventory of this handler’s Inspect status.
Implementations§
Source§impl MouseInjectorHandler
impl MouseInjectorHandler
Sourcepub async fn new(
display_size: Size,
cursor_message_sender: Sender<CursorMessage>,
input_handlers_node: &Node,
metrics_logger: MetricsLogger,
) -> Result<Rc<Self>, Error>
pub async fn new( display_size: Size, cursor_message_sender: Sender<CursorMessage>, input_handlers_node: &Node, metrics_logger: MetricsLogger, ) -> Result<Rc<Self>, Error>
Creates a new mouse handler that holds mouse pointer injectors. The caller is expected to spawn a task to continually watch for updates to the viewport. Example: let handler = MouseInjectorHandler::new(display_size).await?; fasync::Task::local(handler.clone().watch_viewport()).detach();
§Parameters
display_size: The size of the associated display.cursor_message_sender: A [Sender] used to communicate the current cursor state.
§Errors
If unable to connect to pointerinjector protocols.
Sourcepub async fn new_with_config_proxy(
configuration_proxy: SetupProxy,
display_size: Size,
cursor_message_sender: Sender<CursorMessage>,
input_handlers_node: &Node,
metrics_logger: MetricsLogger,
) -> Result<Rc<Self>, Error>
pub async fn new_with_config_proxy( configuration_proxy: SetupProxy, display_size: Size, cursor_message_sender: Sender<CursorMessage>, input_handlers_node: &Node, metrics_logger: MetricsLogger, ) -> Result<Rc<Self>, Error>
Creates a new mouse handler that holds mouse pointer injectors. The caller is expected to spawn a task to continually watch for updates to the viewport. Example: let handler = MouseInjectorHandler::new_with_config_proxy(config_proxy, display_size).await?; fasync::Task::local(handler.clone().watch_viewport()).detach();
§Parameters
configuration_proxy: A proxy used to get configuration details for pointer injection.display_size: The size of the associated display.cursor_message_sender: A [Sender] used to communicate the current cursor state.
§Errors
If unable to get injection view refs from configuration_proxy.
If unable to connect to pointerinjector Registry protocol.
Sourcepub async fn watch_viewport(self: Rc<Self>)
pub async fn watch_viewport(self: Rc<Self>)
Watches for viewport updates from the scene manager.
Trait Implementations§
Source§impl Handler for MouseInjectorHandler
impl Handler for MouseInjectorHandler
Source§impl InputHandler for MouseInjectorHandler
impl InputHandler for MouseInjectorHandler
Source§fn handle_input_event<'async_trait>(
self: Rc<Self>,
input_event: InputEvent,
) -> Pin<Box<dyn Future<Output = Vec<InputEvent>> + 'async_trait>>where
Self: 'async_trait,
fn handle_input_event<'async_trait>(
self: Rc<Self>,
input_event: InputEvent,
) -> Pin<Box<dyn Future<Output = Vec<InputEvent>> + 'async_trait>>where
Self: 'async_trait,
Auto Trait Implementations§
impl !Freeze for MouseInjectorHandler
impl !RefUnwindSafe for MouseInjectorHandler
impl Send for MouseInjectorHandler
impl !Sync for MouseInjectorHandler
impl Unpin for MouseInjectorHandler
impl UnsafeUnpin for MouseInjectorHandler
impl !UnwindSafe for MouseInjectorHandler
Blanket Implementations§
Source§impl<T> BatchInputHandler for Twhere
T: InputHandler,
impl<T> BatchInputHandler for Twhere
T: InputHandler,
Source§fn handle_input_events<'async_trait>(
self: Rc<T>,
input_events: Vec<InputEvent>,
) -> Pin<Box<dyn Future<Output = Vec<InputEvent>> + 'async_trait>>where
T: 'async_trait,
fn handle_input_events<'async_trait>(
self: Rc<T>,
input_events: Vec<InputEvent>,
) -> Pin<Box<dyn Future<Output = Vec<InputEvent>> + 'async_trait>>where
T: 'async_trait,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to [Self]Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more