pub struct ExnType { /* private fields */ }Expand description
A WebAssembly exception-object signature type.
This type captures the signature of an exception object. Note
that the WebAssembly standard does not define concrete types in
the heap-type lattice between exn (any exception object – the
top type) and noexn (the uninhabited bottom type). Wasmtime
defines concrete types based on the signature – that is, the
function type that describes the signature of the exception
payload values – rather than the tag. The tag is a per-instance
nominal entity (similar to a memory or a table) and is associated
only with particular exception objects.
Implementations§
Source§impl ExnType
 
impl ExnType
Sourcepub fn new(
    engine: &Engine,
    fields: impl IntoIterator<Item = ValType>,
) -> Result<ExnType, Error>
 
pub fn new( engine: &Engine, fields: impl IntoIterator<Item = ValType>, ) -> Result<ExnType, Error>
Create a new ExnType.
This function creates a new exception object type with the given signature, i.e., list of payload value types. This signature implies a tag type, and when instantiated at runtime, it must be associated with a tag of that type.
Sourcepub fn from_tag_type(tag: &TagType) -> Result<ExnType, Error>
 
pub fn from_tag_type(tag: &TagType) -> Result<ExnType, Error>
Create a new ExnType from an existing TagType.
This function creates a new exception object type with the
signature represented by the tag. The signature must have no
result values, i.e., must be of the form (T1, T2, ...) -> ().
Sourcepub fn tag_type(&self) -> TagType
 
pub fn tag_type(&self) -> TagType
Get the tag type that this exception type is associated with.
Sourcepub fn field(&self, i: usize) -> Option<FieldType>
 
pub fn field(&self, i: usize) -> Option<FieldType>
Get the ith field type.
Returns None if i is out of bounds.
Sourcepub fn fields(&self) -> impl ExactSizeIterator
 
pub fn fields(&self) -> impl ExactSizeIterator
Returns the list of field types for this function.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExnType
impl !RefUnwindSafe for ExnType
impl Send for ExnType
impl Sync for ExnType
impl Unpin for ExnType
impl !UnwindSafe for ExnType
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
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
§impl<T> Instrument for T
 
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
 
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
 
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more