[−][src]Struct wasmer_vm::Global
TODO: figure out a decent name for this thing
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>(&self) -> Value<T>
[src]
Get a value from the global.
pub unsafe fn set<T>(&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>(&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]
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
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,