pub struct PciInfo {
    pub bus: u32,
    pub bus_id: String,
    pub device: u32,
    pub domain: u32,
    pub pci_device_id: u32,
    pub pci_sub_system_id: Option<u32>,
}
Expand description

PCI information about a GPU device.

Fields

bus: u32

The bus on which the device resides, 0 to 0xff.

bus_id: String

The PCI identifier.

device: u32

The device’s ID on the bus, 0 to 31.

domain: u32

The PCI domain on which the device’s bus resides, 0 to 0xffff.

pci_device_id: u32

The combined 16-bit device ID and 16-bit vendor ID.

pci_sub_system_id: Option<u32>

The 32-bit Sub System Device ID.

Will always be None if this PciInfo was obtained from NvLink.remote_pci_info(). NVIDIA says that the C field that this corresponds to “is not filled … and is indeterminate” when being returned from that specific call.

Will be Some in all other cases.

Implementations

Try to create this struct from its C equivalent.

Passing false for sub_sys_id_present will set the pci_sub_system_id field to None. See the field docs for more.

Errors
  • Utf8Error, if the string obtained from the C function is not valid Utf8

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Convert this PciInfo back into its C equivalent.

Errors
  • NulError, if a nul byte was found in the bus_id (shouldn’t occur?)
  • StringTooLong, if bus_id.len() exceeded the length of NVML_DEVICE_PCI_BUS_ID_BUFFER_SIZE. This should (?) only be able to occur if the user modifies bus_id in some fashion. We return an error rather than panicking.

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.