Struct stackdump_core::device_memory::DeviceMemory
source · [−]pub struct DeviceMemory<RB: RegisterBacking> { /* private fields */ }
Expand description
Object containing all memory regions (we have available) of the device
Implementations
sourceimpl<RB: RegisterBacking> DeviceMemory<RB>
impl<RB: RegisterBacking> DeviceMemory<RB>
sourcepub fn add_memory_region<M: MemoryRegion + 'static>(&mut self, region: M)
pub fn add_memory_region<M: MemoryRegion + 'static>(&mut self, region: M)
Adds a memory region to the device memory
sourcepub fn add_memory_region_boxed(&mut self, region: Box<dyn MemoryRegion>)
pub fn add_memory_region_boxed(&mut self, region: Box<dyn MemoryRegion>)
Adds a memory region to the device memory
sourcepub fn add_register_data<RD: RegisterData<RB> + 'static>(&mut self, data: RD)
pub fn add_register_data<RD: RegisterData<RB> + 'static>(&mut self, data: RD)
Adds register data to the device memory
sourcepub fn add_register_data_boxed(&mut self, data: Box<dyn RegisterData<RB>>)
pub fn add_register_data_boxed(&mut self, data: Box<dyn RegisterData<RB>>)
Adds register data to the device memory
sourcepub fn read_slice(&self, address_range: Range<u64>) -> Option<&[u8]>
pub fn read_slice(&self, address_range: Range<u64>) -> Option<&[u8]>
Returns the slice of memory that can be found at the given address_range. If the given address range is not fully within one of the captured regions present in the device memory, then None is returned.
sourcepub fn read_u8(&self, address: u64) -> Option<u8>
pub fn read_u8(&self, address: u64) -> Option<u8>
Reads a byte from the given address if it is present in one of the captured regions present in the device memory
sourcepub fn read_u32(&self, address: u64, endianness: RunTimeEndian) -> Option<u32>
pub fn read_u32(&self, address: u64, endianness: RunTimeEndian) -> Option<u32>
Reads a u32 from the given address if it is present in one of the captured regions present in the device memory
sourcepub fn register(&self, register: Register) -> Result<RB, MissingRegisterError>
pub fn register(&self, register: Register) -> Result<RB, MissingRegisterError>
Try to get the value of the given register. Returns an error if the register is not present in any of the register collections.
sourcepub fn register_ref(
&self,
register: Register
) -> Result<&RB, MissingRegisterError>
pub fn register_ref(
&self,
register: Register
) -> Result<&RB, MissingRegisterError>
Try to get a reference to the given register. Returns an error if the register is not present in any of the register collections.
sourcepub fn register_mut(
&mut self,
register: Register
) -> Result<&mut RB, MissingRegisterError>
pub fn register_mut(
&mut self,
register: Register
) -> Result<&mut RB, MissingRegisterError>
Try to get a mutable reference to the given register. Returns an error if the register is not present in any of the register collections.
Trait Implementations
sourceimpl<RB: RegisterBacking> Default for DeviceMemory<RB>
impl<RB: RegisterBacking> Default for DeviceMemory<RB>
Auto Trait Implementations
impl<RB> !RefUnwindSafe for DeviceMemory<RB>
impl<RB> !Send for DeviceMemory<RB>
impl<RB> !Sync for DeviceMemory<RB>
impl<RB> Unpin for DeviceMemory<RB>
impl<RB> !UnwindSafe for DeviceMemory<RB>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more