pub struct MemoryLimits { /* private fields */ }Expand description
Linear memory limit metadata.
Implementations§
Source§impl MemoryLimits
impl MemoryLimits
Sourcepub fn new(
minimum: WasmPageCount,
maximum: Option<WasmPageCount>,
) -> Result<Self, WasmMemoryError>
pub fn new( minimum: WasmPageCount, maximum: Option<WasmPageCount>, ) -> Result<Self, WasmMemoryError>
Creates memory limits after checking that ‘maximum >= minimum’ when present.
Marks the memory as shared or unshared.
Marks the memory with an explicit shared-memory marker.
Sourcepub const fn minimum(&self) -> WasmPageCount
pub const fn minimum(&self) -> WasmPageCount
Returns the minimum page count.
Sourcepub const fn minimum_pages(&self) -> u32
pub const fn minimum_pages(&self) -> u32
Returns the minimum page count as a raw integer.
Sourcepub const fn maximum(&self) -> Option<WasmPageCount>
pub const fn maximum(&self) -> Option<WasmPageCount>
Returns the maximum page count when bounded.
Sourcepub const fn maximum_pages(&self) -> Option<u32>
pub const fn maximum_pages(&self) -> Option<u32>
Returns the maximum page count as a raw integer when bounded.
Returns the shared-memory marker.
Returns ‘true’ when the memory is marked as shared.
Trait Implementations§
Source§impl Clone for MemoryLimits
impl Clone for MemoryLimits
Source§fn clone(&self) -> MemoryLimits
fn clone(&self) -> MemoryLimits
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MemoryLimits
impl Debug for MemoryLimits
Source§impl Default for MemoryLimits
impl Default for MemoryLimits
Source§fn default() -> MemoryLimits
fn default() -> MemoryLimits
Returns the “default value” for a type. Read more
Source§impl Hash for MemoryLimits
impl Hash for MemoryLimits
Source§impl PartialEq for MemoryLimits
impl PartialEq for MemoryLimits
Source§fn eq(&self, other: &MemoryLimits) -> bool
fn eq(&self, other: &MemoryLimits) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for MemoryLimits
impl StructuralPartialEq for MemoryLimits
Auto Trait Implementations§
impl Freeze for MemoryLimits
impl RefUnwindSafe for MemoryLimits
impl Send for MemoryLimits
impl Sync for MemoryLimits
impl Unpin for MemoryLimits
impl UnsafeUnpin for MemoryLimits
impl UnwindSafe for MemoryLimits
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