[−][src]Struct pir_8_emu::vm::Memory
Mostly-transparent wrapper for a heap-allocated 64KiB u8
array with R/W tracking
Methods
impl Memory
[src][−]
pub fn new() -> Memory
[src][−]
Create fresh zero-initialised unread and unwritten memory
pub fn iter_rw(&self) -> MemoryReadWrittenIterator
[src][−]
Get an iterator over the read and written memory cells
Examples
let mut memory = Memory::new(); memory[0x4B0B] = memory[0x00A1]; println!("{}", memory[0x4B0B]); memory[0xEB0B] = 0x12; // (address, value, was_read, was_written) assert_eq!(memory.iter_rw().collect::<Vec<_>>(), &[(0x00A1, 0x00, true, false), (0x4B0B, 0x00, true, true), (0xEB0B, 0x12, false, true)]);
pub fn reset_rw(&mut self)
[src][−]
Mark all of memory as unread and unwritten
Examples
let mut memory = Memory::new(); memory[0x4B0B] = memory[0x00A1]; println!("{}", memory[0x4B0B]); memory[0xEB0B] = 0x12; memory.reset_rw(); assert_eq!(memory.iter_rw().collect::<Vec<_>>(), &[]);
Trait Implementations
impl Clone for Memory
[src][+]
impl Debug for Memory
[src][+]
impl Default for Memory
[src][+]
impl Eq for Memory
[src]
impl<'_> From<&'_ [u8]> for Memory
[src][+]
impl Hash for Memory
[src][+]
impl Index<Range<u16>> for Memory
[src][+]
impl Index<RangeFrom<u16>> for Memory
[src][+]
impl Index<RangeFull> for Memory
[src][+]
impl Index<RangeInclusive<u16>> for Memory
[src][+]
impl Index<RangeTo<u16>> for Memory
[src][+]
impl Index<RangeToInclusive<u16>> for Memory
[src][+]
impl Index<u16> for Memory
[src][+]
impl IndexMut<Range<u16>> for Memory
[src][+]
impl IndexMut<RangeFrom<u16>> for Memory
[src][+]
impl IndexMut<RangeFull> for Memory
[src][+]
impl IndexMut<RangeInclusive<u16>> for Memory
[src][+]
impl IndexMut<RangeTo<u16>> for Memory
[src][+]
impl IndexMut<RangeToInclusive<u16>> for Memory
[src][+]
impl IndexMut<u16> for Memory
[src][+]
impl Ord for Memory
[src][+]
impl PartialEq<[u8]> for Memory
[src][+]
impl PartialEq<Memory> for Memory
[src][+]
impl PartialOrd<Memory> for Memory
[src][+]
Auto Trait Implementations
impl RefUnwindSafe for Memory
impl Send for Memory
impl Sync for Memory
impl Unpin for Memory
impl UnwindSafe for Memory
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> Downcast for T where
T: Any,
[src][+]
T: Any,
impl<T> DowncastSync for T where
T: Send + Sync + Any,
[src][+]
T: Send + Sync + Any,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,