Struct cranelift_wasm::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§
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 From<MemoryType> for Memory
impl From<MemoryType> for Memory
source§fn from(ty: MemoryType) -> Memory
fn from(ty: MemoryType) -> Memory
source§impl<'a> FromReader<'a> for MemoryType
impl<'a> FromReader<'a> for MemoryType
source§fn from_reader(
reader: &mut BinaryReader<'a>
) -> Result<MemoryType, BinaryReaderError>
fn from_reader( reader: &mut BinaryReader<'a> ) -> Result<MemoryType, BinaryReaderError>
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<MemoryType> for MemoryType
impl PartialEq<MemoryType> for MemoryType
source§fn eq(&self, other: &MemoryType) -> bool
fn eq(&self, other: &MemoryType) -> bool
self
and other
values to be equal, and is used
by ==
.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§
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.