pub struct FuncType { /* private fields */ }
Expand description
A FuncType represents the parameter and result type(s) of a Wasm func.
Implementations§
Source§impl FuncType
impl FuncType
Sourcepub fn new(
params: impl Into<Vec<(String, Type)>>,
results: impl Into<Vec<(String, Type)>>,
) -> Result<Self, WasmValueError>
pub fn new( params: impl Into<Vec<(String, Type)>>, results: impl Into<Vec<(String, Type)>>, ) -> Result<Self, WasmValueError>
Returns a new FuncType with the given param and result type(s). Returns an error if the resulting func type would be invalid in the component model, e.g. has any unnamed results with more than one result type.
Trait Implementations§
Source§impl WasmFunc for FuncType
impl WasmFunc for FuncType
Source§fn params(&self) -> Box<dyn Iterator<Item = Self::Type> + '_>
fn params(&self) -> Box<dyn Iterator<Item = Self::Type> + '_>
Returns an iterator of the func’s parameter types.
Source§fn param_names(&self) -> Box<dyn Iterator<Item = Cow<'_, str>> + '_>
fn param_names(&self) -> Box<dyn Iterator<Item = Cow<'_, str>> + '_>
Returns an iterator of the func’s parameter names. Must be the same
length as the iterator returned by
params
or empty if this WasmFunc
impl does not support param names.impl StructuralPartialEq for FuncType
Auto Trait Implementations§
impl Freeze for FuncType
impl RefUnwindSafe for FuncType
impl Send for FuncType
impl Sync for FuncType
impl Unpin for FuncType
impl UnwindSafe for FuncType
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