pub struct FlatSpaces { /* private fields */ }Expand description
The set of flat spaces for a module.
Implementations§
Source§impl FlatSpaces
impl FlatSpaces
Sourcepub fn configure(&mut self, ctx: &Context<'_>)
pub fn configure(&mut self, ctx: &Context<'_>)
Learns which spaces are zero-filled. Cheap to call repeatedly: spaces are append-only, so an unchanged count means nothing to redo.
Sourcepub fn slot(&mut self, space: MemorySpaceId) -> usize
pub fn slot(&mut self, space: MemorySpaceId) -> usize
The stable index of space’s storage, creating it on first use.
Resolve this once and address the space with base_ptr_at
thereafter; the index stays valid for the life of these spaces.
Sourcepub fn base_ptr_at(
&mut self,
slot: usize,
len: usize,
) -> Result<*mut u8, EmulatorErrorKind>
pub fn base_ptr_at( &mut self, slot: usize, len: usize, ) -> Result<*mut u8, EmulatorErrorKind>
The base pointer of the storage at slot, grown to hold len bytes.
Panics if slot did not come from slot on these spaces.
Sourcepub fn base_ptr(
&mut self,
space: MemorySpaceId,
len: usize,
) -> Result<*mut u8, EmulatorErrorKind>
pub fn base_ptr( &mut self, space: MemorySpaceId, len: usize, ) -> Result<*mut u8, EmulatorErrorKind>
The base pointer of space’s storage, grown to hold len bytes.
pub fn get(&self, space: MemorySpaceId) -> Option<&FlatSpace>
Sourcepub fn entry(&mut self, space: MemorySpaceId) -> &mut FlatSpace
pub fn entry(&mut self, space: MemorySpaceId) -> &mut FlatSpace
The space’s storage, created on first use.
pub fn read_u128( &self, space: MemorySpaceId, addr: u64, size: usize, ) -> Result<u128, EmulatorErrorKind>
pub fn read_bytes( &self, space: MemorySpaceId, addr: u64, size: usize, ) -> Result<Vec<u8>, EmulatorErrorKind>
Trait Implementations§
Source§impl Clone for FlatSpaces
impl Clone for FlatSpaces
Source§fn clone(&self) -> FlatSpaces
fn clone(&self) -> FlatSpaces
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FlatSpaces
impl Debug for FlatSpaces
Source§impl Default for FlatSpaces
impl Default for FlatSpaces
Source§fn default() -> FlatSpaces
fn default() -> FlatSpaces
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FlatSpaces
impl RefUnwindSafe for FlatSpaces
impl Send for FlatSpaces
impl Sync for FlatSpaces
impl Unpin for FlatSpaces
impl UnsafeUnpin for FlatSpaces
impl UnwindSafe for FlatSpaces
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