pub struct DataStore { /* private fields */ }Expand description
A unified data store that maps (area, db_number, offset) -> u8.
Supports:
- Arbitrary area codes (PI / PA / MK / DB / TI / CT / …)
- Per-area registration (
register_area/unregister_area) - CPU run-state (
cpu_state/set_cpu_state) - Read / write event callbacks
Implementations§
Source§impl DataStore
impl DataStore
Sourcepub fn register_area(&self, area_code: u8, size: usize)
pub fn register_area(&self, area_code: u8, size: usize)
Register a memory area. size is a hint; reads beyond written bytes
return zeros.
Sourcepub fn unregister_area(&self, area_code: u8)
pub fn unregister_area(&self, area_code: u8)
Unregister a previously registered area.
Sourcepub fn is_area_registered(&self, area_code: u8) -> bool
pub fn is_area_registered(&self, area_code: u8) -> bool
Check whether an area is registered.
Sourcepub fn registered_areas(&self) -> Vec<u8> ⓘ
pub fn registered_areas(&self) -> Vec<u8> ⓘ
Return the set of registered area codes.
Sourcepub fn set_cpu_state(&self, state: CpuState)
pub fn set_cpu_state(&self, state: CpuState)
Set the simulated CPU state and fire event_callbacks.
Sourcepub fn read_bytes(&self, db: u16, start: u32, count: u32) -> Vec<u8> ⓘ
pub fn read_bytes(&self, db: u16, start: u32, count: u32) -> Vec<u8> ⓘ
Read a contiguous range of bytes.
Sourcepub fn read_area(&self, area: u8, db: u16, start: u32, count: u32) -> Vec<u8> ⓘ
pub fn read_area(&self, area: u8, db: u16, start: u32, count: u32) -> Vec<u8> ⓘ
Read from an arbitrary area.
Sourcepub fn write_area(&self, area: u8, db: u16, start: u32, data: &[u8])
pub fn write_area(&self, area: u8, db: u16, start: u32, data: &[u8])
Write to an arbitrary area.
Sourcepub fn write_bytes(&self, db: u16, start: u32, data: &[u8])
pub fn write_bytes(&self, db: u16, start: u32, data: &[u8])
Write to DB area (convenience, retained for backward compat).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DataStore
impl RefUnwindSafe for DataStore
impl Send for DataStore
impl Sync for DataStore
impl Unpin for DataStore
impl UnsafeUnpin for DataStore
impl UnwindSafe for DataStore
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