Trait MemoryTr
pub trait MemoryTr {
// Required methods
fn set_data(
&mut self,
memory_offset: usize,
data_offset: usize,
len: usize,
data: &[u8],
);
fn set(&mut self, memory_offset: usize, data: &[u8]);
fn size(&self) -> usize;
fn copy(&mut self, destination: usize, source: usize, len: usize);
fn slice(&self, range: Range<usize>) -> impl Deref<Target = [u8]>;
fn resize(&mut self, new_size: usize) -> bool;
// Provided method
fn slice_len(&self, offset: usize, len: usize) -> impl Deref<Target = [u8]> { ... }
}
Expand description
Trait for Interpreter memory operations.
Required Methods§
fn set_data(
&mut self,
memory_offset: usize,
data_offset: usize,
len: usize,
data: &[u8],
)
fn set_data( &mut self, memory_offset: usize, data_offset: usize, len: usize, data: &[u8], )
Sets memory data at given offset from data with a given data_offset and len.
§Panics
Panics if range is out of scope of allocated memory.
fn copy(&mut self, destination: usize, source: usize, len: usize)
fn copy(&mut self, destination: usize, source: usize, len: usize)
Copies memory data from source to destination.
§Panics
Panics if range is out of scope of allocated memory.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.