pub struct Device { /* private fields */ }
Expand description
Represents a single device in the PCI database.
Every device has a corresponding vendor, a device ID, a pretty name,
and a list of associated SubSystem
s.
Implementations§
Source§impl Device
impl Device
Sourcepub fn from_vid_pid(vid: u16, pid: u16) -> Option<&'static Device>
pub fn from_vid_pid(vid: u16, pid: u16) -> Option<&'static Device>
Returns the Device
corresponding to the given vendor and product IDs,
or None
if no such device exists in the DB.
Sourcepub fn vendor(&self) -> &'static Vendor
pub fn vendor(&self) -> &'static Vendor
Returns the Vendor
that this device belongs to.
Looking up a vendor by device is cheap (O(1)
).
Sourcepub fn as_vid_pid(&self) -> (u16, u16)
pub fn as_vid_pid(&self) -> (u16, u16)
Returns a tuple of (vendor ID, device/“product” ID) for this device.
This is convenient for interactions with other PCI libraries.
Sourcepub fn subsystems(&self) -> impl Iterator<Item = &'static SubSystem>
pub fn subsystems(&self) -> impl Iterator<Item = &'static SubSystem>
Returns an iterator over the device’s subsystems.
NOTE: The PCI database does not include subsystem information for most devices. This list is not authoritative.
Trait Implementations§
impl Copy for Device
impl Eq for Device
impl StructuralPartialEq for Device
Auto Trait Implementations§
impl Freeze for Device
impl RefUnwindSafe for Device
impl Send for Device
impl Sync for Device
impl Unpin for Device
impl UnwindSafe for Device
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