Skip to main content

PlatformDevice

Trait PlatformDevice 

Source
pub trait PlatformDevice {
    type Mmio;

    // Required methods
    fn map_mmio_by_id(
        &self,
        id: u32,
    ) -> impl Future<Output = Result<Self::Mmio, Status>>;
    fn map_mmio_by_name(
        &self,
        name: &str,
    ) -> impl Future<Output = Result<Self::Mmio, Status>>;
    fn get_typed_metadata<T: Persistable + Serializable>(
        &self,
    ) -> impl Future<Output = Result<T, Status>>;
    fn get_deserialized_metadata<T: DeserializeOwned>(
        &self,
    ) -> impl Future<Output = Result<T, Status>>;
}
Expand description

PlatformDevice interface.

Required Associated Types§

Source

type Mmio

The type of the [Mmio] implementation returned by this platform device.

Required Methods§

Source

fn map_mmio_by_id( &self, id: u32, ) -> impl Future<Output = Result<Self::Mmio, Status>>

Maps an MMIO region by its id.

Source

fn map_mmio_by_name( &self, name: &str, ) -> impl Future<Output = Result<Self::Mmio, Status>>

Maps MMIO memory by its name.

Source

fn get_typed_metadata<T: Persistable + Serializable>( &self, ) -> impl Future<Output = Result<T, Status>>

Gets typed metadata associated with this platform device.

Source

fn get_deserialized_metadata<T: DeserializeOwned>( &self, ) -> impl Future<Output = Result<T, Status>>

Gets deserialized metadata associated with this platform device using default ID.

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.

Implementations on Foreign Types§

Source§

impl PlatformDevice for DeviceProxy

Source§

type Mmio = MmioRegion<Memory<VmoMapping>>

Source§

async fn map_mmio_by_id(&self, id: u32) -> Result<Self::Mmio, Status>

Source§

async fn map_mmio_by_name(&self, name: &str) -> Result<Self::Mmio, Status>

Source§

async fn get_typed_metadata<T: Persistable + Serializable>( &self, ) -> Result<T, Status>

Source§

async fn get_deserialized_metadata<T: DeserializeOwned>( &self, ) -> Result<T, Status>

Implementors§