Struct wasmedge_sys::GlobalType
source · pub struct GlobalType { /* private fields */ }
Expand description
Defines the type of a wasm global variable.
A GlobalType classifies a global variable that hold a value and can either be mutable or immutable.
Implementations§
source§impl GlobalType
impl GlobalType
sourcepub fn create(val_ty: ValType, mutable: Mutability) -> WasmEdgeResult<Self>
pub fn create(val_ty: ValType, mutable: Mutability) -> WasmEdgeResult<Self>
Create a new GlobalType to be associated with the given ValType and Mutability.
Arguments
-
val_type
- The value type of the global variable. -
mutability
- The mutability of the global variable.
Errors
If fail to create a new GlobalType, then an error is returned.
sourcepub fn value_type(&self) -> ValType
pub fn value_type(&self) -> ValType
Returns the value type of the GlobalType.
sourcepub fn mutability(&self) -> Mutability
pub fn mutability(&self) -> Mutability
Returns the Mutability value of the GlobalType.
sourcepub fn as_ptr(&self) -> *const WasmEdge_GlobalTypeContext
pub fn as_ptr(&self) -> *const WasmEdge_GlobalTypeContext
Provides a raw pointer to the inner global type context.
Trait Implementations§
source§impl Debug for GlobalType
impl Debug for GlobalType
source§impl Drop for GlobalType
impl Drop for GlobalType
source§impl From<GlobalType> for GlobalType
impl From<GlobalType> for GlobalType
source§impl From<GlobalType> for GlobalType
impl From<GlobalType> for GlobalType
source§fn from(ty: GlobalType) -> Self
fn from(ty: GlobalType) -> Self
Converts to this type from the input type.