[][src]Struct wasmer_runtime::DynFunc

pub struct DynFunc { /* fields omitted */ }

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]

Create a new DynamicFunc.

pub fn signature(&self) -> &FunctionType[src]

Returns the full function signature.

pub fn params(&self) -> &[Type]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Returns the types of the function inputs.

pub fn returns(&self) -> &[Type]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Returns the types of the function outputs.

pub fn call(
    &self,
    params: &[Value<Function>]
) -> Result<Box<[Value<Function>]>, RuntimeError>
[src]

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]

Call the function.

Trait Implementations

impl Clone for DynamicFunc[src]

impl<'a> Exportable<'a> for DynamicFunc[src]

impl<'_> From<&'_ Function> for DynamicFunc[src]

impl From<DynamicFunc> for Extern[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.