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, DriverError>>;
    fn map_mmio_by_name(
        &self,
        name: &str,
    ) -> impl Future<Output = Result<Self::Mmio, DriverError>>;
    fn get_typed_metadata<T: Persistable + Serializable>(
        &self,
    ) -> impl Future<Output = Result<T, DriverError>>;
    fn get_deserialized_metadata<T: DeserializeOwned>(
        &self,
    ) -> impl Future<Output = Result<T, DriverError>>;
    fn get_persisted_metadata_by_id(
        &self,
        metadata_id: &str,
    ) -> impl Future<Output = Result<Vec<u8>, DriverError>>;
    fn get_dictionary_metadata(
        &self,
        metadata_id: &str,
    ) -> impl Future<Output = Result<Dictionary, DriverError>>;
}
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, DriverError>>

Maps an MMIO region by its id.

Source

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

Maps MMIO memory by its name.

Source

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

Gets typed metadata associated with this platform device.

Source

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

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

Source

fn get_persisted_metadata_by_id( &self, metadata_id: &str, ) -> impl Future<Output = Result<Vec<u8>, DriverError>>

Gets persisted metadata bytes associated with this platform device by metadata ID.

Source

fn get_dictionary_metadata( &self, metadata_id: &str, ) -> impl Future<Output = Result<Dictionary, DriverError>>

Gets metadata dictionary associated with this platform device by metadata ID.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl PlatformDevice for Client<Device>

Source§

type Mmio = MmioRegion<Memory<VmoMapping>>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

async fn get_persisted_metadata_by_id( &self, metadata_id: &str, ) -> Result<Vec<u8>, DriverError>

Source§

async fn get_dictionary_metadata( &self, metadata_id: &str, ) -> Result<Dictionary, DriverError>

Implementors§