[−][src]Struct wasmer_runtime::DynFunc
Represents a type-erased function provided by either the host or the WebAssembly program.
Implementations
impl DynamicFunc
[src]
pub fn new<F>(signature: &FunctionType, func: F) -> DynamicFunc where
F: Fn(&mut Ctx, &[Value<Function>]) -> Result<Vec<Value<Function>>, RuntimeError> + 'static,
[src]
F: Fn(&mut Ctx, &[Value<Function>]) -> Result<Vec<Value<Function>>, RuntimeError> + 'static,
Create a new DynamicFunc
.
pub fn signature(&self) -> &FunctionType
[src]
Returns the full function signature.
pub fn params(&self) -> &[Type]ⓘ
[src]
Returns the types of the function inputs.
pub fn returns(&self) -> &[Type]ⓘ
[src]
Returns the types of the function outputs.
pub fn call(
&self,
params: &[Value<Function>]
) -> Result<Box<[Value<Function>]>, RuntimeError>
[src]
&self,
params: &[Value<Function>]
) -> Result<Box<[Value<Function>]>, RuntimeError>
Call the function. In this case, it's an alias to dyn_call
.
pub fn dyn_call(
&self,
params: &[Value<Function>]
) -> Result<Box<[Value<Function>]>, RuntimeError>
[src]
&self,
params: &[Value<Function>]
) -> Result<Box<[Value<Function>]>, RuntimeError>
Call the function.
Trait Implementations
impl Clone for DynamicFunc
[src]
fn clone(&self) -> DynamicFunc
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> Exportable<'a> for DynamicFunc
[src]
fn to_export(&self) -> Export
[src]
fn get_self_from_extern(
r#extern: &'a Extern
) -> Result<&'a DynamicFunc, ExportError>
[src]
r#extern: &'a Extern
) -> Result<&'a DynamicFunc, ExportError>
impl<'_> From<&'_ Function> for DynamicFunc
[src]
fn from(new_function: &Function) -> DynamicFunc
[src]
impl From<DynamicFunc> for Extern
[src]
fn from(dynamic_func: DynamicFunc) -> Extern
[src]
Auto Trait Implementations
impl !RefUnwindSafe for DynamicFunc
impl Send for DynamicFunc
impl Sync for DynamicFunc
impl Unpin for DynamicFunc
impl !UnwindSafe for DynamicFunc
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,