Capability

Trait Capability 

Source
pub trait Capability<'a>:
    PciRegion
    + AsPciSubregion<'a>
    + Clone
    + Copy
    + Debug
    + Sized {
    // Required methods
    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§

Source

fn backed_by(as_subregion: impl AsPciSubregion<'a>) -> Result<Option<Self>>

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.

Source

fn header(&self) -> CapabilityHeader<'a>

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§