Enum walrus::ir::InstrSeqType
source · pub enum InstrSeqType {
Simple(Option<ValType>),
MultiValue(TypeId),
}
Expand description
The type of an instruction sequence.
Variants§
Simple(Option<ValType>)
MVP Wasm blocks/loops/ifs can only push zero or one resulting value onto the stack. They cannot take parameters on the stack.
MultiValue(TypeId)
The multi-value extension to Wasm allows arbitrary stack parameters and results, which are expressed via the same mechanism as function types.
Implementations§
source§impl InstrSeqType
impl InstrSeqType
sourcepub fn new(
types: &mut ModuleTypes,
params: &[ValType],
results: &[ValType]
) -> InstrSeqType
pub fn new( types: &mut ModuleTypes, params: &[ValType], results: &[ValType] ) -> InstrSeqType
Construct a new InstrSeqType
of the correct form for the given
parameter and result types.
sourcepub fn existing(
types: &ModuleTypes,
params: &[ValType],
results: &[ValType]
) -> Option<InstrSeqType>
pub fn existing( types: &ModuleTypes, params: &[ValType], results: &[ValType] ) -> Option<InstrSeqType>
Construct an InstrSeqType
with a signature that is known to either be
Simple
or uses a Type
that has already been inserted into the
ModuleTypes
.
Returns None
if this is an instruction sequence signature that
requires multi-value and ModuleTypes
does not already have a Type
for it.
Trait Implementations§
source§impl Clone for InstrSeqType
impl Clone for InstrSeqType
source§fn clone(&self) -> InstrSeqType
fn clone(&self) -> InstrSeqType
Returns a copy 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 InstrSeqType
impl Debug for InstrSeqType
source§impl From<Id<Type>> for InstrSeqType
impl From<Id<Type>> for InstrSeqType
source§fn from(x: TypeId) -> InstrSeqType
fn from(x: TypeId) -> InstrSeqType
Converts to this type from the input type.
source§impl From<ValType> for InstrSeqType
impl From<ValType> for InstrSeqType
source§fn from(x: ValType) -> InstrSeqType
fn from(x: ValType) -> InstrSeqType
Converts to this type from the input type.
source§impl PartialEq for InstrSeqType
impl PartialEq for InstrSeqType
source§fn eq(&self, other: &InstrSeqType) -> bool
fn eq(&self, other: &InstrSeqType) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for InstrSeqType
impl Eq for InstrSeqType
impl StructuralEq for InstrSeqType
impl StructuralPartialEq for InstrSeqType
Auto Trait Implementations§
impl RefUnwindSafe for InstrSeqType
impl Send for InstrSeqType
impl Sync for InstrSeqType
impl Unpin for InstrSeqType
impl UnwindSafe for InstrSeqType
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.