pub struct HidClass<'a, B: UsbBus, D: HidDevice> { /* private fields */ }
Implementations§
Trait Implementations§
Source§impl<B: UsbBus, D: HidDevice> UsbClass<B> for HidClass<'_, B, D>
impl<B: UsbBus, D: HidDevice> UsbClass<B> for HidClass<'_, B, D>
Source§fn get_configuration_descriptors(
&self,
writer: &mut DescriptorWriter<'_>,
) -> Result<()>
fn get_configuration_descriptors( &self, writer: &mut DescriptorWriter<'_>, ) -> Result<()>
Called when a GET_DESCRIPTOR request is received for a configuration descriptor. When
called, the implementation should write its interface, endpoint and any extra class
descriptors into
writer
. The configuration descriptor itself will be written by
UsbDevice and shouldn’t be written by classes. Read moreSource§fn get_string(&self, _index: StringIndex, _lang_id: u16) -> Option<&str>
fn get_string(&self, _index: StringIndex, _lang_id: u16) -> Option<&str>
Gets a class-specific string descriptor. Read more
Source§fn endpoint_in_complete(&mut self, addr: EndpointAddress)
fn endpoint_in_complete(&mut self, addr: EndpointAddress)
Called when endpoint with address
addr
has completed transmitting data (IN packet). Read moreSource§fn endpoint_out(&mut self, _addr: EndpointAddress)
fn endpoint_out(&mut self, _addr: EndpointAddress)
Called when endpoint with address
addr
has received data (OUT packet). Read moreSource§fn control_in(&mut self, xfer: ControlIn<'_, '_, '_, B>)
fn control_in(&mut self, xfer: ControlIn<'_, '_, '_, B>)
Called when a control request is received with direction DeviceToHost. Read more
Source§fn control_out(&mut self, xfer: ControlOut<'_, '_, '_, B>)
fn control_out(&mut self, xfer: ControlOut<'_, '_, '_, B>)
Called when a control request is received with direction HostToDevice. Read more
Source§fn get_bos_descriptors(
&self,
writer: &mut BosWriter<'_, '_>,
) -> Result<(), UsbError>
fn get_bos_descriptors( &self, writer: &mut BosWriter<'_, '_>, ) -> Result<(), UsbError>
Called when a GET_DESCRIPTOR request is received for a BOS descriptor.
When called, the implementation should write its blobs such as capability
descriptors into
writer
. The BOS descriptor itself will be written by
UsbDevice and shouldn’t be written by classes.Source§fn endpoint_setup(&mut self, addr: EndpointAddress)
fn endpoint_setup(&mut self, addr: EndpointAddress)
Called when endpoint with address
addr
has received a SETUP packet. Implementing this
shouldn’t be necessary in most cases, but is provided for completeness’ sake. Read moreAuto Trait Implementations§
impl<'a, B, D> Freeze for HidClass<'a, B, D>where
D: Freeze,
impl<'a, B, D> RefUnwindSafe for HidClass<'a, B, D>where
D: RefUnwindSafe,
impl<'a, B, D> Send for HidClass<'a, B, D>where
D: Send,
impl<'a, B, D> Sync for HidClass<'a, B, D>where
D: Sync,
impl<'a, B, D> Unpin for HidClass<'a, B, D>where
D: Unpin,
impl<'a, B, D> UnwindSafe for HidClass<'a, B, D>where
D: UnwindSafe,
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
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>
Converts
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>
Converts
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