pub struct DeviceId(/* private fields */);
Expand description
Abstraction for the USB device ID structure, i.e. struct usb_device_id
.
Implementations§
Source§impl DeviceId
impl DeviceId
Sourcepub const fn from_device_ver(
vendor: u16,
product: u16,
bcd_lo: u16,
bcd_hi: u16,
) -> Self
pub const fn from_device_ver( vendor: u16, product: u16, bcd_lo: u16, bcd_hi: u16, ) -> Self
Equivalent to C’s USB_DEVICE_VER
macro.
Sourcepub const fn from_device_info(class: u8, subclass: u8, protocol: u8) -> Self
pub const fn from_device_info(class: u8, subclass: u8, protocol: u8) -> Self
Equivalent to C’s USB_DEVICE_INFO
macro.
Sourcepub const fn from_interface_info(class: u8, subclass: u8, protocol: u8) -> Self
pub const fn from_interface_info(class: u8, subclass: u8, protocol: u8) -> Self
Equivalent to C’s USB_INTERFACE_INFO
macro.
Sourcepub const fn from_device_interface_class(
vendor: u16,
product: u16,
class: u8,
) -> Self
pub const fn from_device_interface_class( vendor: u16, product: u16, class: u8, ) -> Self
Equivalent to C’s USB_DEVICE_INTERFACE_CLASS
macro.
Sourcepub const fn from_device_interface_protocol(
vendor: u16,
product: u16,
protocol: u8,
) -> Self
pub const fn from_device_interface_protocol( vendor: u16, product: u16, protocol: u8, ) -> Self
Equivalent to C’s USB_DEVICE_INTERFACE_PROTOCOL
macro.
Sourcepub const fn from_device_interface_number(
vendor: u16,
product: u16,
number: u8,
) -> Self
pub const fn from_device_interface_number( vendor: u16, product: u16, number: u8, ) -> Self
Equivalent to C’s USB_DEVICE_INTERFACE_NUMBER
macro.
Trait Implementations§
Source§impl RawDeviceId for DeviceId
impl RawDeviceId for DeviceId
Source§impl RawDeviceIdIndex for DeviceId
impl RawDeviceIdIndex for DeviceId
Source§const DRIVER_DATA_OFFSET: usize = 24usize
const DRIVER_DATA_OFFSET: usize = 24usize
The offset (in bytes) to the context/data field in the raw device ID.
Source§fn index(&self) -> usize
fn index(&self) -> usize
The index stored at
DRIVER_DATA_OFFSET
of the implementor of the RawDeviceIdIndex
trait.impl Copy for DeviceId
Auto Trait Implementations§
impl Freeze for DeviceId
impl RefUnwindSafe for DeviceId
impl Send for DeviceId
impl Sync for DeviceId
impl Unpin for DeviceId
impl UnwindSafe for DeviceId
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
Source§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
Initializes
slot
. Read more