Struct lc3_ensemble::sim::MemAccessCtx
source · pub struct MemAccessCtx {
pub privileged: bool,
pub strict: bool,
pub io_effects: bool,
}Expand description
Context behind a memory access.
This struct is used by Simulator::read_mem and Simulator::write_mem to perform checks against memory accesses.
A default memory access context for the given simulator can be constructed with Simulator::default_mem_ctx.
Fields§
§privileged: boolWhether this access is privileged (false = user, true = supervisor).
strict: boolWhether writes to memory should follow strict rules (no writing partially or fully uninitialized data).
This does not affect Simulator::read_mem.
io_effects: boolWhether a read to memory-mapped IO should cause side effects.
This can be set to false to observe the value of IO.
This does not affect Simulator::write_mem.
Implementations§
source§impl MemAccessCtx
impl MemAccessCtx
sourcepub fn omnipotent() -> Self
pub fn omnipotent() -> Self
Allows any access and allows access to (effectless) IO.
Useful for reading state.
Trait Implementations§
source§impl Clone for MemAccessCtx
impl Clone for MemAccessCtx
source§fn clone(&self) -> MemAccessCtx
fn clone(&self) -> MemAccessCtx
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 moresource§impl Debug for MemAccessCtx
impl Debug for MemAccessCtx
impl Copy for MemAccessCtx
Auto Trait Implementations§
impl Freeze for MemAccessCtx
impl RefUnwindSafe for MemAccessCtx
impl Send for MemAccessCtx
impl Sync for MemAccessCtx
impl Unpin for MemAccessCtx
impl UnwindSafe for MemAccessCtx
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)