Struct wasmparser::MemoryType
source · [−]pub struct MemoryType {
pub memory64: bool,
pub shared: bool,
pub initial: u64,
pub maximum: Option<u64>,
}
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
.
Implementations
sourceimpl MemoryType
impl MemoryType
sourcepub fn index_type(&self) -> ValType
pub fn index_type(&self) -> ValType
Gets the index type for the memory.
Trait Implementations
sourceimpl Clone for MemoryType
impl Clone for MemoryType
sourcefn clone(&self) -> MemoryType
fn clone(&self) -> MemoryType
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for MemoryType
impl Debug for MemoryType
sourceimpl Hash for MemoryType
impl Hash for MemoryType
sourceimpl PartialEq<MemoryType> for MemoryType
impl PartialEq<MemoryType> for MemoryType
sourcefn eq(&self, other: &MemoryType) -> bool
fn eq(&self, other: &MemoryType) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
impl Copy for MemoryType
impl Eq for MemoryType
impl StructuralEq for MemoryType
impl StructuralPartialEq for MemoryType
Auto Trait Implementations
impl RefUnwindSafe for MemoryType
impl Send for MemoryType
impl Sync for MemoryType
impl Unpin for MemoryType
impl UnwindSafe for MemoryType
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.