Struct Memory

#[repr(transparent)]
pub struct Memory { /* private fields */ }

MDN documentation

Implementations

impl Memory

fn grow(&self, pages: u32) -> u32

The grow() prototype method of the Memory object increases the size of the memory instance by a specified number of WebAssembly pages.

Takes the number of pages to grow (64KiB in size) and returns the previous size of memory, in pages.

MDN documentation

impl Memory

fn new(descriptor: &Object) -> Result<Memory, JsValue>

The WebAssembly.Memory() constructor creates a new Memory object which is a resizable ArrayBuffer that holds the raw bytes of memory accessed by a WebAssembly Instance.

A memory created by JavaScript or in WebAssembly code will be accessible and mutable from both JavaScript and WebAssembly.

MDN documentation

impl Memory

fn buffer(&self) -> JsValue

An accessor property that returns the buffer contained in the memory.

MDN documentation

Trait Implementations

impl AsRef<JsValue> for Memory

fn as_ref(&self) -> &JsValue

impl AsRef<Memory> for Memory

fn as_ref(&self) -> &Memory

impl AsRef<Object> for Memory

fn as_ref(&self) -> &Object

impl Clone for Memory

fn clone(&self) -> Self

impl Debug for Memory

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Deref for Memory

type Target = Object;
fn deref(&self) -> &Object

impl Eq for Memory

impl ErasableGeneric for Memory

type Repr = JsValue;

impl From<JsValue> for Memory

fn from(obj: JsValue) -> Self

impl FromWasmAbi for Memory

type Abi = <JsValue as FromWasmAbi>::Abi;
unsafe fn from_abi(js: Self::Abi) -> Self

impl IntoJsGeneric for Memory where Memory: JsGeneric,

type JsCanon = Memory;
fn to_js(self) -> Memory

impl IntoWasmAbi for Memory

type Abi = <JsValue as IntoWasmAbi>::Abi;
fn into_abi(self) -> Self::Abi

impl JsCast for Memory

fn instanceof(val: &JsValue) -> bool
fn unchecked_from_js(val: JsValue) -> Self
fn unchecked_from_js_ref(val: &JsValue) -> &Self

impl LongRefFromWasmAbi for Memory

type Abi = <JsValue as LongRefFromWasmAbi>::Abi;
type Anchor = Memory;
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor

impl OptionFromWasmAbi for Memory

fn is_none(abi: &Self::Abi) -> bool

impl OptionIntoWasmAbi for Memory

fn none() -> Self::Abi

impl PartialEq for Memory

fn eq(&self, other: &Self) -> bool

impl Promising for Memory

type Resolution = Memory;

impl RefFromWasmAbi for Memory

type Abi = <JsValue as RefFromWasmAbi>::Abi;
type Anchor = ManuallyDrop<Memory>;
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor

impl StructuralPartialEq for Memory

impl UpcastFrom<Memory> for Memory

impl WasmDescribe for Memory

fn describe()

Auto Trait Implementations

impl Freeze for Memory

impl RefUnwindSafe for Memory

impl Send for Memory

impl Sync for Memory

impl Unpin for Memory

impl UnsafeUnpin for Memory

impl UnwindSafe for Memory

Blanket Implementations

impl<P, T> Receiver for Memory where P: Deref<Target = T> + ?Sized, T: ?Sized,

impl<S, T> Upcast<T> for Memory where T: UpcastFrom<S> + ?Sized, S: ?Sized,

impl<T> Any for Memory where T: 'static + ?Sized,

impl<T> Borrow<T> for Memory where T: ?Sized,

impl<T> BorrowMut<T> for Memory where T: ?Sized,

impl<T> CloneToUninit for Memory where T: Clone,

impl<T> From<T> for Memory

impl<T> JsGeneric for Memory where T: ErasableGeneric<Repr = JsValue> + UpcastFrom<T> + Upcast<JsValue> + JsCast + 'static,

impl<T> ReturnWasmAbi for Memory where T: IntoWasmAbi,

impl<T> ToOwned for Memory where T: Clone,

impl<T> TryFromJsValue for Memory where T: JsCast,

impl<T> VectorFromWasmAbi for Memory where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorIntoWasmAbi for Memory where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorRefIntoWasmAbi for Memory where &'a T: for<'a> Into<JsValue>,

impl<T, U> Into<U> for Memory where U: From<T>,

impl<T, U> TryFrom<U> for Memory where U: Into<T>,

impl<T, U> TryInto<U> for Memory where U: TryFrom<T>,