Struct wasmtime::MemoryType
source · pub struct MemoryType { /* private fields */ }
Expand description
A descriptor for a WebAssembly memory type.
Memories are described in units of pages (64KB) and represent contiguous chunks of addressable memory.
Implementations§
source§impl MemoryType
impl MemoryType
sourcepub fn new(minimum: u32, maximum: Option<u32>) -> MemoryType
pub fn new(minimum: u32, maximum: Option<u32>) -> MemoryType
Creates a new descriptor for a 32-bit WebAssembly memory given the specified limits of the memory.
The minimum
and maximum
values here are specified in units of
WebAssembly pages, which are 64k.
sourcepub fn new64(minimum: u64, maximum: Option<u64>) -> MemoryType
pub fn new64(minimum: u64, maximum: Option<u64>) -> MemoryType
Creates a new descriptor for a 64-bit WebAssembly memory given the specified limits of the memory.
The minimum
and maximum
values here are specified in units of
WebAssembly pages, which are 64k.
Note that 64-bit memories are part of the memory64 proposal for WebAssembly which is not standardized yet.
Creates a new descriptor for shared WebAssembly memory given the specified limits of the memory.
The minimum
and maximum
values here are specified in units of
WebAssembly pages, which are 64k.
Note that shared memories are part of the threads proposal for WebAssembly which is not standardized yet.
sourcepub fn is_64(&self) -> bool
pub fn is_64(&self) -> bool
Returns whether this is a 64-bit memory or not.
Note that 64-bit memories are part of the memory64 proposal for WebAssembly which is not standardized yet.
Returns whether this is a shared memory or not.
Note that shared memories are part of the threads proposal for WebAssembly which is not standardized yet.
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 ExternType
impl From<MemoryType> for ExternType
source§fn from(ty: MemoryType) -> ExternType
fn from(ty: MemoryType) -> ExternType
source§impl Hash for MemoryType
impl Hash for MemoryType
source§impl PartialEq for MemoryType
impl PartialEq 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 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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default 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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more