pub trait Capability<'a>: PciRegion + AsPciSubregion<'a> + Clone + Copy + Debug + Sized {
    fn backed_by(as_subregion: impl AsPciSubregion<'a>) -> Result<Option<Self>>;
    fn header(&self) -> CapabilityHeader<'a>;
}
Expand description

Some specific type of PCI Capability.

Required Methods

Tries to create an instance of this Capability backed by the given AsPciSubregion. If things like for instance the Capablity ID and possibly other factors don’t match what is expected for the present type, returns Ok(None).

Implementations should also make sure that the subregion is big enough, and fail with an error if it isn’t.

The spec doesn’t really define a header part explicitly, but this holds the two fields that are common to all Capabilities.

Implementors