pub enum ReferenceType {
Function,
External,
}Expand description
Reference types classify first-class references to objects in the runtime store. The type 𝖿𝗎𝗇𝖼𝗋𝖾𝖿 denotes the infinite union of all references to functions, regardless of their function types. The type 𝖾𝗑𝗍𝖾𝗋𝗇𝗋𝖾𝖿 denotes the infinite union of all references to objects owned by the embedder and that can be passed into WebAssembly under this type. Reference types are opaque, meaning that neither their size nor their bit pattern can be observed. Values of reference type can be stored in tables.
See https://webassembly.github.io/spec/core/syntax/types.html#reference-types
§Examples
use wasm_ast::{ValueType, ReferenceType};
assert_eq!(ValueType::FunctionReference, ReferenceType::Function.into());
assert_eq!(ValueType::ExternalReference, ReferenceType::External.into());Variants§
Trait Implementations§
Source§impl Clone for ReferenceType
impl Clone for ReferenceType
Source§fn clone(&self) -> ReferenceType
fn clone(&self) -> ReferenceType
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReferenceType
impl Debug for ReferenceType
Source§impl From<ReferenceType> for ValueType
impl From<ReferenceType> for ValueType
Source§fn from(kind: ReferenceType) -> Self
fn from(kind: ReferenceType) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ReferenceType
impl PartialEq for ReferenceType
impl Copy for ReferenceType
impl Eq for ReferenceType
impl StructuralPartialEq for ReferenceType
Auto Trait Implementations§
impl Freeze for ReferenceType
impl RefUnwindSafe for ReferenceType
impl Send for ReferenceType
impl Sync for ReferenceType
impl Unpin for ReferenceType
impl UnwindSafe for ReferenceType
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