Struct ExnType
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§
§impl ExnType
impl ExnType
pub 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.
pub 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, ...) -> ()
.
pub fn field(&self, i: usize) -> Option<FieldType>
pub fn field(&self, i: usize) -> Option<FieldType>
Get the i
th field type.
Returns None
if i
is out of bounds.
pub 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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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