Struct wasmedge_sys::MemType

source ·
pub struct MemType { /* private fields */ }
Expand description

Defines the type of a wasm memory instance

Implementations§

Create a new MemType to be associated with the given limit range for the capacity.

Arguments
  • ‘min’ - The initial size of the linear memory.

  • ‘max’ - The upper bound of the linear memory size allowed to grow. If ‘max’ is set ‘None’, then the maximum size will be set u32::MAX.

  • shared - Whether the memory is shared or not. Reference Threading proposal for WebAssembly for details about shared memory. If shared is set true, then max MUST not be None.

Errors

If fail to create a MemType, then an error is returned.

Example
let ty = MemType::create(0, Some(u32::MAX), false);

Returns the initial size of a Memory.

Returns the maximum size of a Memory allowed to grow.

Returns whether the memory is shared or not.

Provides a raw pointer to the inner memory type context.

Trait Implementations§

Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more
Converts to this type from the input type.
Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.