Struct wasmparser::MemoryType
source · pub struct MemoryType {
pub memory64: bool,
pub shared: bool,
pub initial: u64,
pub maximum: Option<u64>,
pub page_size_log2: Option<u32>,
}
Expand description
Represents a memory’s type.
Fields§
§memory64: bool
Whether or not this is a 64-bit memory, using i64 as an index. If this is false it’s a 32-bit memory using i32 as an index.
This is part of the memory64 proposal in WebAssembly.
Whether or not this is a “shared” memory, indicating that it should be
send-able across threads and the maximum
field is always present for
valid types.
This is part of the threads proposal in WebAssembly.
initial: u64
Initial size of this memory, in wasm pages.
For 32-bit memories (when memory64
is false
) this is guaranteed to
be at most u32::MAX
for valid types.
maximum: Option<u64>
Optional maximum size of this memory, in wasm pages.
For 32-bit memories (when memory64
is false
) this is guaranteed to
be at most u32::MAX
for valid types. This field is always present for
valid wasm memories when shared
is true
.
page_size_log2: Option<u32>
The log base 2 of the memory’s custom page size.
Memory pages are, by default, 64KiB large (i.e. 216 or
65536
).
The custom-page-sizes proposal allows changing it to other values.
Implementations§
source§impl MemoryType
impl MemoryType
sourcepub fn index_type(&self) -> ValType
pub fn index_type(&self) -> ValType
Gets the index type for the memory.
Trait Implementations§
source§impl Clone for MemoryType
impl Clone for MemoryType
source§fn clone(&self) -> MemoryType
fn clone(&self) -> MemoryType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MemoryType
impl Debug for MemoryType
source§impl<'a> FromReader<'a> for MemoryType
impl<'a> FromReader<'a> for MemoryType
source§fn from_reader(reader: &mut BinaryReader<'a>) -> Result<Self>
fn from_reader(reader: &mut BinaryReader<'a>) -> Result<Self>
Self
from the provided binary reader, returning an
error if it is unable to do so.source§impl Hash for MemoryType
impl Hash for MemoryType
source§impl PartialEq for MemoryType
impl PartialEq for MemoryType
impl Copy for MemoryType
impl Eq for MemoryType
impl StructuralPartialEq for MemoryType
Auto Trait Implementations§
impl Freeze for MemoryType
impl RefUnwindSafe for MemoryType
impl Send for MemoryType
impl Sync for MemoryType
impl Unpin for MemoryType
impl UnwindSafe for MemoryType
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.