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
Available on crate feature ffi
only.
pub fn as_ptr(&self) -> *const WasmEdge_GlobalTypeContext
ffi
only.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§fn from(ty: GlobalType) -> Self
fn from(ty: GlobalType) -> Self
Converts to this type from the input type.
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.
Auto Trait Implementations§
impl RefUnwindSafe for GlobalType
impl Send for GlobalType
impl Sync for GlobalType
impl Unpin for GlobalType
impl UnwindSafe for GlobalType
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