Struct wasmer_vm::VMGlobalDefinition[][src]

#[repr(C, align(16))]
pub struct VMGlobalDefinition { /* fields omitted */ }
Expand description

The storage for a WebAssembly global defined within the instance.

TODO: Pack the globals more densely, rather than using the same size for every type.

Implementations

impl VMGlobalDefinition[src]

pub fn new() -> Self[src]

Construct a VMGlobalDefinition.

pub fn to_i32(&self) -> i32[src]

Return the value as an i32.

If this is not an I32 typed global it is unspecified what value is returned.

pub unsafe fn as_i32_mut(&mut self) -> &mut i32[src]

Return a mutable reference to the value as an i32.

Safety

It is the callers responsibility to make sure the global has I32 type. Until the returned borrow is dropped, reads and writes of this global must be done exclusively through this borrow. That includes reads and writes of globals inside wasm functions.

pub fn to_u32(&self) -> u32[src]

Return a reference to the value as an u32.

If this is not an I32 typed global it is unspecified what value is returned.

pub unsafe fn as_u32_mut(&mut self) -> &mut u32[src]

Return a mutable reference to the value as an u32.

Safety

It is the callers responsibility to make sure the global has I32 type. Until the returned borrow is dropped, reads and writes of this global must be done exclusively through this borrow. That includes reads and writes of globals inside wasm functions.

pub fn to_i64(&self) -> i64[src]

Return a reference to the value as an i64.

If this is not an I64 typed global it is unspecified what value is returned.

pub unsafe fn as_i64_mut(&mut self) -> &mut i64[src]

Return a mutable reference to the value as an i64.

Safety

It is the callers responsibility to make sure the global has I32 type. Until the returned borrow is dropped, reads and writes of this global must be done exclusively through this borrow. That includes reads and writes of globals inside wasm functions.

pub fn to_u64(&self) -> u64[src]

Return a reference to the value as an u64.

If this is not an I64 typed global it is unspecified what value is returned.

pub unsafe fn as_u64_mut(&mut self) -> &mut u64[src]

Return a mutable reference to the value as an u64.

Safety

It is the callers responsibility to make sure the global has I64 type. Until the returned borrow is dropped, reads and writes of this global must be done exclusively through this borrow. That includes reads and writes of globals inside wasm functions.

pub fn to_f32(&self) -> f32[src]

Return a reference to the value as an f32.

If this is not an F32 typed global it is unspecified what value is returned.

pub unsafe fn as_f32_mut(&mut self) -> &mut f32[src]

Return a mutable reference to the value as an f32.

Safety

It is the callers responsibility to make sure the global has F32 type. Until the returned borrow is dropped, reads and writes of this global must be done exclusively through this borrow. That includes reads and writes of globals inside wasm functions.

pub fn to_f64(&self) -> f64[src]

Return a reference to the value as an f64.

If this is not an F64 typed global it is unspecified what value is returned.

pub unsafe fn as_f64_mut(&mut self) -> &mut f64[src]

Return a mutable reference to the value as an f64.

Safety

It is the callers responsibility to make sure the global has F64 type. Until the returned borrow is dropped, reads and writes of this global must be done exclusively through this borrow. That includes reads and writes of globals inside wasm functions.

pub fn to_funcref(&self) -> VMFuncRef[src]

Return a reference to the value as a VMFuncRef.

If this is not a VMFuncRef typed global it is unspecified what value is returned.

pub unsafe fn as_funcref_mut(&mut self) -> &mut VMFuncRef[src]

Return a mutable reference to the value as a VMFuncRef.

Safety

It is the callers responsibility to make sure the global has VMFuncRef type. Until the returned borrow is dropped, reads and writes of this global must be done exclusively through this borrow. That includes reads and writes of globals inside wasm functions.

pub unsafe fn as_externref_mut(&mut self) -> &mut VMExternRef[src]

Return a mutable reference to the value as an VMExternRef.

Safety

It is the callers responsibility to make sure the global has I32 type. Until the returned borrow is dropped, reads and writes of this global must be done exclusively through this borrow. That includes reads and writes of globals inside wasm functions.

pub fn to_externref(&self) -> VMExternRef[src]

Return a reference to the value as an VMExternRef.

If this is not an I64 typed global it is unspecified what value is returned.

pub fn to_u128(&self) -> u128[src]

Return a reference to the value as an u128.

If this is not an V128 typed global it is unspecified what value is returned.

pub unsafe fn as_u128_mut(&mut self) -> &mut u128[src]

Return a mutable reference to the value as an u128.

Safety

It is the callers responsibility to make sure the global has V128 type. Until the returned borrow is dropped, reads and writes of this global must be done exclusively through this borrow. That includes reads and writes of globals inside wasm functions.

pub fn to_bytes(&self) -> [u8; 16][src]

Return a reference to the value as bytes.

pub unsafe fn as_bytes_mut(&mut self) -> &mut [u8; 16][src]

Return a mutable reference to the value as bytes.

Safety

Until the returned borrow is dropped, reads and writes of this global must be done exclusively through this borrow. That includes reads and writes of globals inside wasm functions.

Trait Implementations

impl Clone for VMGlobalDefinition[src]

fn clone(&self) -> VMGlobalDefinition[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for VMGlobalDefinition[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl MemoryUsage for VMGlobalDefinition[src]

fn size_of_val(&self, visited: &mut dyn MemoryUsageTracker) -> usize[src]

Returns the size of the referenced value in bytes. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> ArchivePointee for T

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.

pub fn pointer_metadata(
    &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointee for T

type Metadata = ()

The type for metadata in pointers and references to Self.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.