pub struct SharedMemory(_);
Expand description

For shared memory (and only for shared memory), this lock-version restricts access when growing the memory or checking its size. This is to conform with the thread proposal: “When IsSharedArrayBuffer(...) is true, the return value should be the result of an atomic read-modify-write of the new size to the internal length slot.”

Implementations§

Construct a new SharedMemory.

Wrap an existing Memory with the locking provided by a SharedMemory.

Return the memory type for this SharedMemory.

Convert this shared memory into a Memory.

Return a pointer to the shared memory’s VMMemoryDefinition.

Same as RuntimeLinearMemory::grow, except with &self.

Implementation of memory.atomic.notify for this shared memory.

Implementation of memory.atomic.wait32 for this shared memory.

Implementation of memory.atomic.wait64 for this shared memory.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Proxy all calls through the RwLock.

Returns the number of allocated bytes.
Returns the maximum number of bytes the memory can grow to. Returns None if the memory is unbounded. Read more
Grows a memory by delta_pages. Read more
Grow memory to the specified amount of bytes. Read more
Return a VMMemoryDefinition for exposing the memory to compiled wasm code. Read more
Does this memory need initialization? It may not if it already has initial contents courtesy of the MemoryImage passed to RuntimeMemoryCreator::new_memory(). Read more
Used for optional dynamic downcasting.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.