Skip to main content

BusRouter

Trait BusRouter 

Source
pub trait BusRouter {
    // Required methods
    fn dispatch(&self, access: &BusAccess) -> Result<BusResponse, DeviceError>;
    fn lookup(&self, access: &BusAccess) -> Result<Arc<dyn Device>, DeviceError>;
}
Expand description

Bus dispatch interface — the runtime hot-path half of a [AxVmDevices].

Called on every vCPU exit that targets an emulated device (MMIO / Port / SysReg).

Required Methods§

Source

fn dispatch(&self, access: &BusAccess) -> Result<BusResponse, DeviceError>

Looks up the device responsible for access and forwards the access to it, returning the result.

Source

fn lookup(&self, access: &BusAccess) -> Result<Arc<dyn Device>, DeviceError>

Looks up the device responsible for access without handling the access. The caller can then inspect the device or call Device::handle manually.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§