pub trait Memory {
// Required methods
fn get_data<T: Sized>(&self, offset: WasmPtr<T>) -> Result<&T, Errno>;
fn get_slice<T: Sized>(
&self,
offset: WasmPtr<T>,
len: usize
) -> Result<&[T], Errno>;
fn get_iovec<'a>(
&self,
iovec_ptr: WasmPtr<__wasi_ciovec_t>,
iovec_len: __wasi_size_t
) -> Result<Vec<IoSlice<'a>>, Errno>;
fn mut_data<T: Sized>(
&mut self,
offset: WasmPtr<T>
) -> Result<&mut T, Errno>;
fn mut_slice<T: Sized>(
&mut self,
offset: WasmPtr<T>,
len: usize
) -> Result<&mut [T], Errno>;
fn mut_iovec(
&mut self,
iovec_ptr: WasmPtr<__wasi_iovec_t>,
iovec_len: __wasi_size_t
) -> Result<Vec<IoSliceMut<'_>>, Errno>;
fn write_data<T: Sized>(
&mut self,
offset: WasmPtr<T>,
data: T
) -> Result<(), Errno>;
}
Required Methods§
fn get_data<T: Sized>(&self, offset: WasmPtr<T>) -> Result<&T, Errno>
fn get_slice<T: Sized>( &self, offset: WasmPtr<T>, len: usize ) -> Result<&[T], Errno>
fn get_iovec<'a>( &self, iovec_ptr: WasmPtr<__wasi_ciovec_t>, iovec_len: __wasi_size_t ) -> Result<Vec<IoSlice<'a>>, Errno>
fn mut_data<T: Sized>(&mut self, offset: WasmPtr<T>) -> Result<&mut T, Errno>
fn mut_slice<T: Sized>( &mut self, offset: WasmPtr<T>, len: usize ) -> Result<&mut [T], Errno>
fn mut_iovec( &mut self, iovec_ptr: WasmPtr<__wasi_iovec_t>, iovec_len: __wasi_size_t ) -> Result<Vec<IoSliceMut<'_>>, Errno>
fn write_data<T: Sized>( &mut self, offset: WasmPtr<T>, data: T ) -> Result<(), Errno>
Object Safety§
This trait is not object safe.