Struct nvml_wrapper::struct_wrappers::device::PciInfo
source · 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§
source§impl PciInfo
impl PciInfo
sourcepub fn try_from(
struct_: nvmlPciInfo_t,
sub_sys_id_present: bool
) -> Result<Self, NvmlError>
pub fn try_from( struct_: nvmlPciInfo_t, sub_sys_id_present: bool ) -> Result<Self, NvmlError>
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§
source§impl PartialEq for PciInfo
impl PartialEq for PciInfo
source§impl TryInto<nvmlPciInfo_st> for PciInfo
impl TryInto<nvmlPciInfo_st> for PciInfo
source§fn try_into(self) -> Result<nvmlPciInfo_t, Self::Error>
fn try_into(self) -> Result<nvmlPciInfo_t, Self::Error>
Convert this PciInfo
back into its C equivalent.
§Errors
NulError
, if a nul byte was found in the bus_id (shouldn’t occur?)StringTooLong
, ifbus_id.len()
exceeded the length ofNVML_DEVICE_PCI_BUS_ID_BUFFER_SIZE
. This should (?) only be able to occur if the user modifiesbus_id
in some fashion. We return an error rather than panicking.
impl Eq for PciInfo
impl StructuralPartialEq for PciInfo
Auto Trait Implementations§
impl RefUnwindSafe for PciInfo
impl Send for PciInfo
impl Sync for PciInfo
impl Unpin for PciInfo
impl UnwindSafe for PciInfo
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