pub struct MouseBinding { /* private fields */ }
Expand description
A MouseBinding
represents a connection to a mouse input device.
The MouseBinding
parses and exposes mouse descriptor properties (e.g., the range of
possible x values) for the device it is associated with. It also parses InputReport
s
from the device, and sends them to the device binding owner over event_sender
.
Implementations§
Source§impl MouseBinding
impl MouseBinding
Sourcepub async fn new(
device_proxy: InputDeviceProxy,
device_id: u32,
input_event_sender: UnboundedSender<InputEvent>,
device_node: Node,
metrics_logger: MetricsLogger,
) -> Result<Self, Error>
pub async fn new( device_proxy: InputDeviceProxy, device_id: u32, input_event_sender: UnboundedSender<InputEvent>, device_node: Node, metrics_logger: MetricsLogger, ) -> Result<Self, Error>
Creates a new InputDeviceBinding
from the device_proxy
.
The binding will start listening for input reports immediately and send new InputEvents
to the device binding owner over input_event_sender
.
§Parameters
device_proxy
: The proxy to bind the newInputDeviceBinding
to.device_id
: The id of the connected mouse device.input_event_sender
: The channel to send new InputEvents to.device_node
: The inspect node for this device bindingmetrics_logger
: The metrics logger.
§Errors
If there was an error binding to the proxy.
Trait Implementations§
Source§impl InputDeviceBinding for MouseBinding
impl InputDeviceBinding for MouseBinding
Source§fn input_event_sender(&self) -> UnboundedSender<InputEvent>
fn input_event_sender(&self) -> UnboundedSender<InputEvent>
Returns the input event stream’s sender.
Source§fn get_device_descriptor(&self) -> InputDeviceDescriptor
fn get_device_descriptor(&self) -> InputDeviceDescriptor
Returns information about the input device.
Auto Trait Implementations§
impl Freeze for MouseBinding
impl !RefUnwindSafe for MouseBinding
impl Send for MouseBinding
impl Sync for MouseBinding
impl Unpin for MouseBinding
impl !UnwindSafe for MouseBinding
Blanket Implementations§
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
Mutably borrows from an owned value. Read more