Struct PciDevice

Source
pub struct PciDevice { /* private fields */ }
Expand description

A struct representing the data of a PCI device as discovered through the OS APIs by the enumerator in use. An enumerator is not required to fill all the fields of a PciDevice object. As such most members are optional and only the vendor_id() and device_id() are required to be valid. Check the documentation of the enumerator in use to see what values are expected to be filled.

Implementations§

Source§

impl PciDevice

Source

pub fn from_pci_header_set( header: PciCommonHeader, specialized: Option<PciSpecializedHeader>, ) -> Self

Source

pub fn vendor_id(&self) -> u16

Returns the id of the vendor of this device. The vendor is usually the provider of the chipset or technology upon which the device is based.

For example, the 3D Blaster Banshee is a graphic card from Diamond Multimedia based on 3dfx Banshee chipset. The subsystem_vendor_id for that card is the one for Diamond Multimedia, while vendor_id is the one for 3dfx, the provider of the graphic chipset.

Source

pub fn device_id(&self) -> u16

Returns the device id of the device.

Source

pub fn location(&self) -> Result<PciLocation, &PciInfoPropertyError>

Returs an optional PciLocation object that contains the location of the device on the PCI bus (in terms of bus, device and function)

Source

pub fn subsystem_vendor_id(&self) -> Result<Option<u16>, &PciInfoPropertyError>

Returns the vendor id of the manufacturer of this device. The vendor is usually the provider of the actual card/device.

For example, the 3D Blaster Banshee is a graphic card from Diamond Multimedia based on 3dfx Banshee chipset. The subsystem_vendor_id for that card is the one for Diamond Multimedia, while vendor_id is the one for 3dfx, the provider of the graphic chipset.

Source

pub fn subsystem_device_id(&self) -> Result<Option<u16>, &PciInfoPropertyError>

Returns the subsystem_device_id. See the documentation for subsystem_vendor_id for the difference between normal ids and subsystem ids.

Source

pub fn revision(&self) -> Result<u8, &PciInfoPropertyError>

Returns the revision of the device.

Source

pub fn device_class_code(&self) -> Result<u8, &PciInfoPropertyError>

Returns the code of the PCI device class. Use device_class if an intelligible enumeration is preferred.

Source

pub fn device_subclass_code(&self) -> Result<u8, &PciInfoPropertyError>

Returns the code of the PCI device subclass. Use device_subclass if an intelligible enumeration is preferred.

Source

pub fn device_iface_code(&self) -> Result<u8, &PciInfoPropertyError>

Returns the code of the PCI interface function. Use device_iface if an intelligible enumeration is preferred.

Source

pub fn device_class(&self) -> Result<PciDeviceClass, &PciInfoPropertyError>

Returns the PCI device class of this device.

Source

pub fn device_subclass( &self, ) -> Result<PciDeviceSubclass, &PciInfoPropertyError>

Returns the PCI device subclass of this device.

Source

pub fn device_iface( &self, ) -> Result<PciDeviceInterfaceFunc, &PciInfoPropertyError>

Returns the PCI interface function of this device.

Source

pub fn os_irq(&self) -> Result<Option<u8>, &PciInfoPropertyError>

Returns the IRQ that the OS has associated to the device.

Source

pub fn os_driver(&self) -> Result<&Option<String>, &PciInfoPropertyError>

Returns the name of the driver that handles the device in the OS.

Source

pub fn pci_common_header( &self, ) -> Result<&PciCommonHeader, &PciInfoPropertyError>

Source

pub fn pci_specialized_header( &self, ) -> Result<&PciSpecializedHeader, &PciInfoPropertyError>

Trait Implementations§

Source§

impl Debug for PciDevice

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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 = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.