pub trait BiosMemory {
// Required methods
fn read_u8(&mut self, linear: u32) -> Option<u8>;
fn write_u8(&mut self, linear: u32, value: u8) -> bool;
fn read(&mut self, linear: u32, out: &mut [u8]) -> bool;
fn write(&mut self, linear: u32, bytes: &[u8]) -> bool;
}Expand description
Guest memory access used by the service model.
Addresses are guest-physical (linear) addresses. Every method is
bounds-checked by the adapter: an unmapped or out-of-range access returns
None/false and never panics.
Required Methods§
Sourcefn read_u8(&mut self, linear: u32) -> Option<u8>
fn read_u8(&mut self, linear: u32) -> Option<u8>
Reads one byte. Returns None when the address is not readable.
Sourcefn write_u8(&mut self, linear: u32, value: u8) -> bool
fn write_u8(&mut self, linear: u32, value: u8) -> bool
Writes one byte. Returns false when the address is not writable.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".