Struct wasmer_vm::Global[][src]

pub struct Global { /* fields omitted */ }
Expand description

A Global instance

Implementations

impl Global[src]

pub fn new(global_type: GlobalType) -> Self[src]

Create a new, zero bit-pattern initialized global from a GlobalType.

pub fn ty(&self) -> &GlobalType[src]

Get the type of the global.

pub fn vmglobal(&self) -> NonNull<VMGlobalDefinition>[src]

Get a pointer to the underlying definition used by the generated code.

pub fn get<T: WasmValueType>(&self, store: &dyn Any) -> Value<T>[src]

Get a value from the global.

pub unsafe fn set<T: WasmValueType>(
    &self,
    val: Value<T>
) -> Result<(), GlobalError>
[src]

Set a value for the global.

Safety

The caller should check that the val comes from the same store as this global.

pub unsafe fn set_unchecked<T: WasmValueType>(
    &self,
    val: Value<T>
) -> Result<(), GlobalError>
[src]

Set a value from the global (unchecked)

Safety

The caller should check that the val comes from the same store as this global. The caller should also ensure that this global is synchronized. Otherwise, use set instead.

Trait Implementations

impl Debug for Global[src]

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

Formats the value using the given formatter. Read more

impl MemoryUsage for Global[src]

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

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

impl Send for Global[src]

Safety

This is safe to send between threads because there is no-thread specific logic. TODO: look into other reasons that make something not Send

impl Sync for Global[src]

Safety

This is safe to share between threads because it uses a Mutex internally.

Auto Trait Implementations

impl !RefUnwindSafe for Global

impl Unpin for Global

impl !UnwindSafe for Global

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, 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.