pub struct BaseRegistry<const STRICT: bool>(/* private fields */);Expand description
A VMO handler registry that retrieves registered handlers by VMO KOID.
If STRICT is true, creating a handler for an unregistered VMO panics.
Otherwise, it falls back to Passthrough.
Use BaseRegistry::register_handler or
ScopedRegistry::register_handler to register RegistryHandler
implementations that can be retrieved at-a-distance based on the VMO KOID.
Use this handler implementation in testing situations where the MMIO VMO
might come over FIDL from an injected dependency. Register the VMO in a
Registry before returning the VMO in an injected dependency fake.
Implementations§
Source§impl<const STRICT: bool> BaseRegistry<STRICT>
impl<const STRICT: bool> BaseRegistry<STRICT>
Sourcepub fn register_handler<H: RegistryHandler>(vmo: &Vmo, handler: H)
pub fn register_handler<H: RegistryHandler>(vmo: &Vmo, handler: H)
Registers handler for vmo.
The handler is installed in the global registry and never removed. See
ScopedRegistry for alternatives.
Registers a shared reference-counted handler for vmo.
The handler is installed in the global registry and never removed. See
ScopedRegistry for alternatives.
Trait Implementations§
Source§impl<const STRICT: bool> GenericVmoMemoryHandler for BaseRegistry<STRICT>
impl<const STRICT: bool> GenericVmoMemoryHandler for BaseRegistry<STRICT>
Source§fn load<T: MmioOperand>(&self, op: VmoOpHelper<'_, T>) -> T
fn load<T: MmioOperand>(&self, op: VmoOpHelper<'_, T>) -> T
T.Source§fn store<T: MmioOperand>(&self, op: VmoOpHelper<'_, T>, value: T)
fn store<T: MmioOperand>(&self, op: VmoOpHelper<'_, T>, value: T)
T.