pub struct PciLocation { /* private fields */ }
Expand description
A location in the PCI hierarchy (i.e. a segment:bus:device.function
tuple).
The segment (also called domain in some contexts) is usually zero and
unsupported by most enumerators.
Implementations§
Source§impl PciLocation
impl PciLocation
Sourcepub fn with_bdf(bus: u8, device: u8, function: u8) -> Result<Self, PciInfoError>
pub fn with_bdf(bus: u8, device: u8, function: u8) -> Result<Self, PciInfoError>
Creates a new PciLocation
with an empty segment
Sourcepub fn with_bdf_u16(bdf: u16) -> Self
pub fn with_bdf_u16(bdf: u16) -> Self
Creates a new PciLocation
with an empty segment starting from
a PCI location expressed as a 16bit integer
Sourcepub fn with_segment(
segment: u16,
bus: u8,
device: u8,
function: u8,
) -> Result<Self, PciInfoError>
pub fn with_segment( segment: u16, bus: u8, device: u8, function: u8, ) -> Result<Self, PciInfoError>
Creates a new PciLocation
also specifying the PCI segment
Sourcepub fn bus_number(&self) -> PciBusNumber
pub fn bus_number(&self) -> PciBusNumber
Gets the bus component of the PCI location as a PciBusNumber
Sourcepub fn segment(&self) -> u16
pub fn segment(&self) -> u16
Gets the segment (sometimes called PCI domain) component of the PCI location. This is zero on most systems as most systems have only one PCI segment/domain. Also most enumerators do not support correct deserializing of PCI segments, and systems with multiple PCI segments are rare enough to make testing very difficult.
Trait Implementations§
Source§impl Clone for PciLocation
impl Clone for PciLocation
Source§fn clone(&self) -> PciLocation
fn clone(&self) -> PciLocation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more