pub struct FlatSpace { /* private fields */ }Expand description
One densely-addressed space.
Implementations§
Source§impl FlatSpace
impl FlatSpace
Sourcepub fn base_ptr(&mut self, len: usize) -> Result<*mut u8, EmulatorErrorKind>
pub fn base_ptr(&mut self, len: usize) -> Result<*mut u8, EmulatorErrorKind>
Grows the space so len bytes are addressable, and returns the base
pointer of its storage.
For compiled code, which addresses this storage directly rather than through the accessors. The caller must not cause the space to grow while holding the pointer — growing may reallocate — which is why the required size is requested up front.
pub fn read_bytes( &self, addr: u64, size: usize, ) -> Result<Vec<u8>, EmulatorErrorKind>
Sourcepub fn read_u128(
&self,
addr: u64,
size: usize,
) -> Result<u128, EmulatorErrorKind>
pub fn read_u128( &self, addr: u64, size: usize, ) -> Result<u128, EmulatorErrorKind>
Reads a little-endian unsigned integer, matching the emulator’s value domain (which is at most 16 bytes wide).
pub fn write_bytes( &mut self, addr: u64, bytes: &[u8], ) -> Result<(), EmulatorErrorKind>
Sourcepub fn write_u128(
&mut self,
addr: u64,
size: usize,
bits: u128,
) -> Result<(), EmulatorErrorKind>
pub fn write_u128( &mut self, addr: u64, size: usize, bits: u128, ) -> Result<(), EmulatorErrorKind>
Writes the low size bytes of a little-endian integer.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FlatSpace
impl RefUnwindSafe for FlatSpace
impl Send for FlatSpace
impl Sync for FlatSpace
impl Unpin for FlatSpace
impl UnsafeUnpin for FlatSpace
impl UnwindSafe for FlatSpace
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more