#[non_exhaustive]pub struct UsbDeviceFilter {
pub vendor_id: Option<u16>,
pub product_id: Option<u16>,
pub class_code: Option<u8>,
pub subclass_code: Option<u8>,
pub protocol_code: Option<u8>,
pub serial_number: Option<String>,
}
Expand description
A filter used to match specific USB devices by various criteria.
Fields left as None
will match any value in that field.
Fields (Non-exhaustive)ยง
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.vendor_id: Option<u16>
Optional USB vendor ID.
product_id: Option<u16>
Optional USB product ID.
class_code: Option<u8>
Optional USB device class code.
subclass_code: Option<u8>
Optional USB device subclass code.
protocol_code: Option<u8>
Optional USB device protocol code.
serial_number: Option<String>
Optional USB device serial number.
Implementationsยง
Sourceยงimpl UsbDeviceFilter
impl UsbDeviceFilter
Sourcepub const fn with_vendor_id(self, vendor_id: u16) -> Self
pub const fn with_vendor_id(self, vendor_id: u16) -> Self
Filter by vendor id.
Sourcepub const fn with_product_id(self, product_id: u16) -> Self
pub const fn with_product_id(self, product_id: u16) -> Self
Filter by product id.
Sourcepub const fn with_class_code(self, class_code: u8) -> Self
pub const fn with_class_code(self, class_code: u8) -> Self
Filter by device class.
Sourcepub const fn with_subclass_code(self, subclass_code: u8) -> Self
pub const fn with_subclass_code(self, subclass_code: u8) -> Self
Filter by device subclass.
Sourcepub const fn with_protocol_code(self, protocol_code: u8) -> Self
pub const fn with_protocol_code(self, protocol_code: u8) -> Self
Filter by device protocol.
Sourcepub fn with_serial_number<S: Into<String>>(self, serial_number: S) -> Self
pub fn with_serial_number<S: Into<String>>(self, serial_number: S) -> Self
Filter by serial number.
Trait Implementationsยง
Sourceยงimpl Clone for UsbDeviceFilter
impl Clone for UsbDeviceFilter
Sourceยงfn clone(&self) -> UsbDeviceFilter
fn clone(&self) -> UsbDeviceFilter
Returns a duplicate of the value. Read more
1.0.0 ยท Sourceยงconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSourceยงimpl Debug for UsbDeviceFilter
impl Debug for UsbDeviceFilter
Sourceยงimpl Default for UsbDeviceFilter
impl Default for UsbDeviceFilter
Sourceยงfn default() -> UsbDeviceFilter
fn default() -> UsbDeviceFilter
Returns the โdefault valueโ for a type. Read more
Sourceยงimpl From<&UsbDeviceFilter> for UsbDeviceFilter
impl From<&UsbDeviceFilter> for UsbDeviceFilter
Sourceยงfn from(value: &UsbDeviceFilter) -> Self
fn from(value: &UsbDeviceFilter) -> Self
Converts to this type from the input type.
Auto Trait Implementationsยง
impl Freeze for UsbDeviceFilter
impl RefUnwindSafe for UsbDeviceFilter
impl Send for UsbDeviceFilter
impl Sync for UsbDeviceFilter
impl Unpin for UsbDeviceFilter
impl UnwindSafe for UsbDeviceFilter
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