Struct stackdump_core::device_memory::DeviceMemory
source · [−]pub struct DeviceMemory<'memory, RB: Integral> { /* private fields */ }
Expand description
Object containing all memory regions (we have available) of the device
Implementations
sourceimpl<'memory, RB: Integral> DeviceMemory<'memory, RB>
impl<'memory, RB: Integral> DeviceMemory<'memory, RB>
sourcepub fn add_memory_region<M: MemoryRegion + 'memory>(&mut self, region: M)
pub fn add_memory_region<M: MemoryRegion + 'memory>(&mut self, region: M)
Adds a memory region to the device memory
sourcepub fn add_register_data<RD: RegisterData<RB> + 'memory>(&mut self, data: RD)
pub fn add_register_data<RD: RegisterData<RB> + 'memory>(&mut self, data: RD)
Adds register data to the device memory
sourcepub fn read_slice(
&self,
address_range: Range<u64>
) -> Result<Option<Vec<u8>>, MemoryReadError>
pub fn read_slice(
&self,
address_range: Range<u64>
) -> Result<Option<Vec<u8>>, MemoryReadError>
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) -> Result<Option<u8>, MemoryReadError>
pub fn read_u8(&self, address: u64) -> Result<Option<u8>, MemoryReadError>
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
) -> Result<Option<u32>, MemoryReadError>
pub fn read_u32(
&self,
address: u64,
endianness: RunTimeEndian
) -> Result<Option<u32>, MemoryReadError>
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
Auto Trait Implementations
impl<'memory, RB> !RefUnwindSafe for DeviceMemory<'memory, RB>
impl<'memory, RB> !Send for DeviceMemory<'memory, RB>
impl<'memory, RB> !Sync for DeviceMemory<'memory, RB>
impl<'memory, RB> Unpin for DeviceMemory<'memory, RB>
impl<'memory, RB> !UnwindSafe for DeviceMemory<'memory, RB>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more