Struct wasmedge_sdk::MemoryType
pub struct MemoryType { /* private fields */ }
Expand description
Parses in-memory bytes as either the WebAssembly Text format, or a binary WebAssembly module Struct of WasmEdge MemoryType.
A MemoryType is used to declare the size range of a WasmEdge Memory to be created.
Implementations§
§impl MemoryType
impl MemoryType
pub fn new(
min: u32,
max: Option<u32>,
shared: bool
) -> Result<MemoryType, Box<WasmEdgeError, Global>>
pub fn new(
min: u32,
max: Option<u32>,
shared: bool
) -> Result<MemoryType, Box<WasmEdgeError, Global>>
Creates a new MemoryType with the given size range.
Arguments
-
min
- The minimum size of the memory to be created. -
max
- The maximum size of the memory to be created. Ifshared
is set to true,max
must be set. -
shared
- Enables shared memory if true.
pub fn minimum(&self) -> u32
pub fn minimum(&self) -> u32
Returns the minimum size defined in the MemoryType.
pub fn maximum(&self) -> Option<u32>
pub fn maximum(&self) -> Option<u32>
Returns the maximum size defined in the MemoryType.
Returns whether the memory is shared.
Trait Implementations§
§impl Clone for MemoryType
impl Clone for MemoryType
§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 more§impl Debug for MemoryType
impl Debug for MemoryType
§impl Default for MemoryType
impl Default for MemoryType
§fn default() -> MemoryType
fn default() -> MemoryType
Returns the “default value” for a type. Read more
§impl From<MemType> for MemoryType
impl From<MemType> for MemoryType
§fn from(ty: MemType) -> MemoryType
fn from(ty: MemType) -> MemoryType
Converts to this type from the input type.
§impl PartialEq<MemoryType> for MemoryType
impl PartialEq<MemoryType> for MemoryType
§fn 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 ==
.