Enum wasmer_types::Value [−][src]
pub enum Value<T> { I32(i32), I64(i64), F32(f32), F64(f64), ExternRef(ExternRef), FuncRef(Option<T>), V128(u128), }
Expand description
Possible runtime values that a WebAssembly module can either consume or produce.
Variants
I32(i32)
A 32-bit integer.
In Wasm integers are sign-agnostic, i.e. this can either be signed or unsigned.
I64(i64)
A 64-bit integer.
In Wasm integers are sign-agnostic, i.e. this can either be signed or unsigned.
F32(f32)
A 32-bit float.
F64(f64)
A 64-bit float.
ExternRef(ExternRef)
An externref
value which can hold opaque data to the wasm instance itself.
Note that this is a nullable value as well.
FuncRef(Option<T>)
A first-class reference to a WebAssembly function.
V128(u128)
A 128-bit number
Implementations
Writes it’s value to a given pointer
Safety
p
must be:
- Sufficiently aligned for the Rust equivalent of the type in
self
- Non-null and pointing to valid, mutable memory
Gets a Value
given a pointer and a Type
Safety
p
must be:
- Properly aligned to the specified
ty
’s Rust equivalent - Non-null and pointing to valid memory
Attempt to access the underlying value of this Value
, returning
None
if it is not the correct type.
Returns the underlying value of this Value
, panicking if it’s the
wrong type.
Panics
Panics if self
is not of the right type.
Attempt to access the underlying value of this Value
, returning
None
if it is not the correct type.
Returns the underlying value of this Value
, panicking if it’s the
wrong type.
Panics
Panics if self
is not of the right type.
Attempt to access the underlying value of this Value
, returning
None
if it is not the correct type.
Returns the underlying value of this Value
, panicking if it’s the
wrong type.
Panics
Panics if self
is not of the right type.
Attempt to access the underlying value of this Value
, returning
None
if it is not the correct type.
Returns the underlying value of this Value
, panicking if it’s the
wrong type.
Panics
Panics if self
is not of the right type.
Attempt to access the underlying value of this Value
, returning
None
if it is not the correct type.
Returns the underlying value of this Value
, panicking if it’s the
wrong type.
Panics
Panics if self
is not of the right type.
Attempt to access the underlying value of this Value
, returning
None
if it is not the correct type.
Returns the underlying value of this Value
, panicking if it’s the
wrong type.
Panics
Panics if self
is not of the right type.
Attempt to access the underlying value of this Value
, returning
None
if it is not the correct type.
Returns the underlying value of this Value
, panicking if it’s the
wrong type.
Panics
Panics if self
is not of the right type.
Trait Implementations
Auto Trait Implementations
impl<T> !RefUnwindSafe for Value<T>
impl<T> !UnwindSafe for Value<T>
Blanket Implementations
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Converts some archived metadata to the pointer metadata for itself.
Mutably borrows from an owned value. Read more