pub struct RawMemory { /* private fields */ }Expand description
This is used to get raw memory access to any memory device.
Implementations§
Source§impl RawMemory
impl RawMemory
Sourcepub async fn read_with_progress<F>(
&self,
address: usize,
length: usize,
progress_callback: F,
) -> Result<Vec<u8>>
pub async fn read_with_progress<F>( &self, address: usize, length: usize, progress_callback: F, ) -> Result<Vec<u8>>
Read raw data from the memory device at the specified address and length and report progress via the provided callback.
§Arguments
address- The starting address to read fromlength- The number of bytes to readprogress_callback- A callback function that takes two usize arguments: the number of bytes read so far and the total number of bytes to read.
§Returns
A Result containing a vector of bytes read from the memory or an `Error
if the operation fails
Sourcepub async fn write_with_progress<F>(
&self,
address: usize,
data: &[u8],
progress_callback: F,
) -> Result<()>
pub async fn write_with_progress<F>( &self, address: usize, data: &[u8], progress_callback: F, ) -> Result<()>
Write raw data to the memory device at the specified address and report progress via the provided callback.
§Arguments
address- The starting address to write todata- A slice of bytes to write to the memoryprogress_callback- A callback function that takes two usize arguments: the number of bytes written so far and the total number of bytes to write.
§Returns
A Result indicating success or failure of the write operation
Trait Implementations§
Source§impl FromMemoryBackend for RawMemory
impl FromMemoryBackend for RawMemory
Source§async fn from_memory_backend(memory: MemoryBackend) -> Result<Self>
async fn from_memory_backend(memory: MemoryBackend) -> Result<Self>
Create a memory-specific type from a
MemoryBackend. When created the
memory is automatically read to populate the fields of the type. Read moreSource§async fn initialize_memory_backend(memory: MemoryBackend) -> Result<Self>
async fn initialize_memory_backend(memory: MemoryBackend) -> Result<Self>
Get a specific memory by its ID and initialize it according to the defaults. Note that the
values will not be written to the memory by default, the user needs to handle this. Read more
Source§fn close_memory(self) -> MemoryBackend
fn close_memory(self) -> MemoryBackend
Close the memory and return the backend to the subsystem Read more
Auto Trait Implementations§
impl Freeze for RawMemory
impl RefUnwindSafe for RawMemory
impl Send for RawMemory
impl Sync for RawMemory
impl Unpin for RawMemory
impl UnsafeUnpin for RawMemory
impl UnwindSafe for RawMemory
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