Skip to main content

Mouse

Struct Mouse 

Source
pub struct Mouse;
Expand description

Boot-compatible mouse: send a report for every movement or button change, and send MouseReport::default once the movement has been reported.

Implementations§

Source§

impl Mouse

Source

pub const fn new() -> Self

Create a boot mouse.

Trait Implementations§

Source§

impl Default for Mouse

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<B: UsbBus> HidDevice<B> for Mouse

Source§

fn spec(&self) -> HidSpec

Report descriptor, endpoint sizes and interface class/protocol.
Source§

fn get_report( &mut self, _report_type: ReportType, _report_id: u8, _buf: &mut [u8], ) -> Option<usize>

Get Report — copy the report selected by report_type and report_id into buf and return its length, including the report ID byte when the spec declares report IDs. Read more
Source§

fn set_report( &mut self, _report_type: ReportType, _report_id: u8, _data: &[u8], ) -> bool

Set Report — handle a report written by the host. Read more
Source§

fn output_report(&mut self, _report_id: u8, _data: &[u8])

Output report received on the interrupt OUT endpoint. Read more
Source§

fn reset(&mut self)

Called after a USB bus reset.
Source§

fn configure(&mut self)

Called when the host configures the device. Read more
Source§

fn deconfigure(&mut self)

Called when the host de-configures the device.
Source§

fn poll(&mut self, _input: &EndpointIn<'_, B>)

Called on every device poll while configured. Read more

Auto Trait Implementations§

§

impl Forget for Mouse

§

impl Freeze for Mouse

§

impl Move for Mouse

§

impl RefUnwindSafe for Mouse

§

impl Send for Mouse

§

impl Sync for Mouse

§

impl Unpin for Mouse

§

impl UnsafeUnpin for Mouse

§

impl UnwindSafe for Mouse

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.