pub struct MemoryType { /* private fields */ }
Expand description
A Wasm memory descriptor.
Implementations§
Source§impl MemoryType
impl MemoryType
Sourcepub fn new(minimum: u32, maximum: Option<u32>) -> Self
pub fn new(minimum: u32, maximum: Option<u32>) -> Self
Creates a new memory type with minimum and optional maximum pages.
§Panics
- If the
minimum
pages exceeds themaximum
pages. - If the
minimum
ormaximum
pages are out of bounds.
Sourcepub fn new64(minimum: u64, maximum: Option<u64>) -> Self
pub fn new64(minimum: u64, maximum: Option<u64>) -> Self
Creates a new 64-bit memory type with minimum and optional maximum pages.
§Panics
- If the
minimum
pages exceeds themaximum
pages. - If the
minimum
ormaximum
pages are out of bounds.
64-bit memories are part of the Wasm memory64
proposal.
Sourcepub fn builder() -> MemoryTypeBuilder
pub fn builder() -> MemoryTypeBuilder
Returns a MemoryTypeBuilder
to incrementally construct a MemoryType
.
Sourcepub fn is_64(&self) -> bool
pub fn is_64(&self) -> bool
Returns true
if this is a 64-bit MemoryType
.
64-bit memories are part of the Wasm memory64
proposal.
Trait Implementations§
Source§impl Clone for MemoryType
impl Clone for MemoryType
Source§fn clone(&self) -> MemoryType
fn clone(&self) -> MemoryType
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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(memory: MemoryType) -> Self
fn from(memory: MemoryType) -> Self
Converts to this type from the input type.
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
Mutably borrows from an owned value. Read more