Skip to main content

Keyboard

Struct Keyboard 

Source
pub struct Keyboard<'d, C: HostController> { /* private fields */ }
Expand description

A keyboard driven through its boot-protocol interrupt endpoint.

Implementations§

Source§

impl<'d, C: HostController> Keyboard<'d, C>

Source

pub fn open(device: &Device<'d, C>) -> HostResult<Self>

Find the boot keyboard interface of device, put it in boot protocol mode and open its interrupt IN endpoint.

The device has to be configured already (Device::set_configuration), because the interface is only live afterwards.

Source

pub fn read(&self) -> HostResult<Report>

Wait for the next report.

The endpoint NAKs until something changed, so this blocks for up to the NAK retry budget of the controller.

Source

pub fn endpoint(&self) -> EndpointAddress

The interrupt IN endpoint the keyboard is read from.

Auto Trait Implementations§

§

impl<'d, C> !Freeze for Keyboard<'d, C>

§

impl<'d, C> !RefUnwindSafe for Keyboard<'d, C>

§

impl<'d, C> !Sync for Keyboard<'d, C>

§

impl<'d, C> Forget for Keyboard<'d, C>

§

impl<'d, C> Move for Keyboard<'d, C>

§

impl<'d, C> Send for Keyboard<'d, C>
where Pipe<'d, C>: Send,

§

impl<'d, C> Unpin for Keyboard<'d, C>
where Pipe<'d, C>: Unpin,

§

impl<'d, C> UnsafeUnpin for Keyboard<'d, C>
where Pipe<'d, C>: UnsafeUnpin,

§

impl<'d, C> UnwindSafe for Keyboard<'d, C>
where Pipe<'d, C>: UnwindSafe,

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.