PciCapability

Trait PciCapability 

Source
pub trait PciCapability:
    Send
    + Sync
    + Inspect
    + ProtobufSaveRestore {
    // Required methods
    fn label(&self) -> &str;
    fn capability_id(&self) -> CapabilityId;
    fn len(&self) -> usize;
    fn read_u32(&self, offset: u16) -> u32;
    fn write_u32(&mut self, offset: u16, val: u32);
    fn reset(&mut self);

    // Provided methods
    fn as_pci_express(&self) -> Option<&PciExpressCapability> { ... }
    fn as_pci_express_mut(&mut self) -> Option<&mut PciExpressCapability> { ... }
}
Expand description

A generic PCI configuration space capability structure.

Required Methods§

Source

fn label(&self) -> &str

A descriptive label for use in Save/Restore + Inspect output

Source

fn capability_id(&self) -> CapabilityId

Returns the PCI capability ID for this capability

Source

fn len(&self) -> usize

Length of the capability structure

Source

fn read_u32(&self, offset: u16) -> u32

Read a u32 at the given offset

Source

fn write_u32(&mut self, offset: u16, val: u32)

Write a u32 at the given offset

Source

fn reset(&mut self)

Reset the capability

Provided Methods§

Source

fn as_pci_express(&self) -> Option<&PciExpressCapability>

Downcast to PCI Express capability

Source

fn as_pci_express_mut(&mut self) -> Option<&mut PciExpressCapability>

Downcast to PCI Express capability (mutable)

Implementors§

Source§

impl PciCapability for MsiCapability

Source§

impl PciCapability for PciExpressCapability

Source§

impl<T> PciCapability for ReadOnlyCapability<T>
where T: IntoBytes + Send + Sync + Debug + Immutable + KnownLayout + 'static,