pub trait MemoryTrait {
// 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]> + '_ { ... }
}
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)
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.