Struct MemoryState
pub struct MemoryState { /* private fields */ }
Expand description
Memory state of a CPU.
Implementations§
§impl MemoryState
impl MemoryState
pub fn new<I: Iterator<Item = MemoryEntry>>(items: I) -> MemoryState
pub fn new<I: Iterator<Item = MemoryEntry>>(items: I) -> MemoryState
Creates a new memory state from the items in items
.
pub fn from_vec(data: Vec<MemoryEntry>) -> MemoryState
pub fn from_vec(data: Vec<MemoryEntry>) -> MemoryState
Creates a new memory state from the items in data
.
pub fn get_mut(&mut self, index: usize) -> MemoryStateItemMut<'_>
pub fn get_mut(&mut self, index: usize) -> MemoryStateItemMut<'_>
Returns a mutable reference to the memory entry at position index
.
Does not panic until the item is used.
pub fn iter(&self) -> Iter<'_, MemoryEntry>
pub fn iter(&self) -> Iter<'_, MemoryEntry>
Iterates over all memory entries in the mapping.
pub fn areas(&self) -> impl ExactSizeIterator<Item = Area> + '_
pub fn areas(&self) -> impl ExactSizeIterator<Item = Area> + '_
Iterates over all areas mapped by the memory mappings.
pub fn get(&self, index: usize) -> &MemoryEntry
pub fn get(&self, index: usize) -> &MemoryEntry
Returns a read-only reference to a memory entry.
pub fn get_checked(&self, index: usize) -> Option<&MemoryEntry>
pub fn get_checked(&self, index: usize) -> Option<&MemoryEntry>
Returns the memory entry at position index
, or None
if it does not exist.
Trait Implementations§
§impl Clone for MemoryState
impl Clone for MemoryState
§fn clone(&self) -> MemoryState
fn clone(&self) -> MemoryState
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for MemoryState
impl Debug for MemoryState
§impl Default for MemoryState
impl Default for MemoryState
§fn default() -> MemoryState
fn default() -> MemoryState
Returns the “default value” for a type. Read more
§impl Display for MemoryState
impl Display for MemoryState
§impl PartialEq for MemoryState
impl PartialEq for MemoryState
impl Eq for MemoryState
impl StructuralPartialEq for MemoryState
Auto Trait Implementations§
impl Freeze for MemoryState
impl RefUnwindSafe for MemoryState
impl Send for MemoryState
impl Sync for MemoryState
impl Unpin for MemoryState
impl UnwindSafe for MemoryState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more