Struct wasmi::MemoryRef
[−]
[src]
pub struct MemoryRef(_);
Reference to a MemoryInstance
.
This reference has a reference-counting semantics.
Methods from Deref<Target = MemoryInstance>
fn initial_pages(&self) -> u32
[src]
fn maximum_pages(&self) -> Option<u32>
[src]
fn size(&self) -> u32
[src]
Return linear memory size (in pages).
fn get(&self, offset: u32, size: usize) -> Result<Vec<u8>, Error>
[src]
Get data at given offset.
fn get_into(&self, offset: u32, target: &mut [u8]) -> Result<(), Error>
[src]
Write memory slice into another slice
fn set(&self, offset: u32, value: &[u8]) -> Result<(), Error>
[src]
Set data at given offset.
fn grow(&self, pages: u32) -> Result<u32, Error>
[src]
Increases the size of the linear memory by given number of pages. Returns previous memory size (in pages) if succeeds.
fn copy(
&self,
src_offset: usize,
dst_offset: usize,
len: usize
) -> Result<(), Error>
[src]
&self,
src_offset: usize,
dst_offset: usize,
len: usize
) -> Result<(), Error>
Copy memory region. Semantically equivalent to memmove
.
fn copy_nonoverlapping(
&self,
src_offset: usize,
dst_offset: usize,
len: usize
) -> Result<(), Error>
[src]
&self,
src_offset: usize,
dst_offset: usize,
len: usize
) -> Result<(), Error>
Copy memory region, non-overlapping version. Semantically equivalent to memcpy
,
but returns Error if source overlaping with destination.
fn clear(&self, offset: usize, new_val: u8, len: usize) -> Result<(), Error>
[src]
Clear memory region with a specified value. Semantically equivalent to memset
.
fn zero(&self, offset: usize, len: usize) -> Result<(), Error>
[src]
Zero memory region
Trait Implementations
impl Clone for MemoryRef
[src]
fn clone(&self) -> MemoryRef
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for MemoryRef
[src]
impl Deref for MemoryRef
[src]
type Target = MemoryInstance
The resulting type after dereferencing.
fn deref(&self) -> &MemoryInstance
[src]
Dereferences the value.