Struct wasmer_runtime_core_x::Func

source ·
pub struct Func<'a, Args = (), Rets = (), Inner: Kind = Wasm> { /* private fields */ }
Expand description

Represents a function that can be used by WebAssembly.

Implementations§

source§

impl<'a, Args, Rets> Func<'a, Args, Rets, Host>
where Args: WasmTypeList, Rets: WasmTypeList,

source

pub fn new<F, Kind>(func: F) -> Self
where Kind: HostFunctionKind, F: HostFunction<Kind, Args, Rets>,

Creates a new Func.

source§

impl<'a, Args, Rets, Inner> Func<'a, Args, Rets, Inner>
where Args: WasmTypeList, Rets: WasmTypeList, Inner: Kind,

source

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

Returns the types of the function inputs.

source

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

Returns the types of the function outputs.

source

pub fn get_vm_func(&self) -> NonNull<Func>

Get the underlying func pointer.

source§

impl<'a, Rets> Func<'a, (), Rets, Wasm>
where Rets: WasmTypeList,

source

pub fn call(&self) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, Rets> Func<'a, A, Rets, Wasm>
where A: WasmExternType, Rets: WasmTypeList,

source

pub fn call(&self, A: A) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, Rets> Func<'a, (A, B), Rets, Wasm>

source

pub fn call(&self, A: A, B: B) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, C, Rets> Func<'a, (A, B, C), Rets, Wasm>

source

pub fn call(&self, A: A, B: B, C: C) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, C, D, Rets> Func<'a, (A, B, C, D), Rets, Wasm>

source

pub fn call(&self, A: A, B: B, C: C, D: D) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, C, D, E, Rets> Func<'a, (A, B, C, D, E), Rets, Wasm>

source

pub fn call(&self, A: A, B: B, C: C, D: D, E: E) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, C, D, E, F, Rets> Func<'a, (A, B, C, D, E, F), Rets, Wasm>

source

pub fn call( &self, A: A, B: B, C: C, D: D, E: E, F: F ) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, C, D, E, F, G, Rets> Func<'a, (A, B, C, D, E, F, G), Rets, Wasm>

source

pub fn call( &self, A: A, B: B, C: C, D: D, E: E, F: F, G: G ) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, C, D, E, F, G, H, Rets> Func<'a, (A, B, C, D, E, F, G, H), Rets, Wasm>

source

pub fn call( &self, A: A, B: B, C: C, D: D, E: E, F: F, G: G, H: H ) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, C, D, E, F, G, H, I, Rets> Func<'a, (A, B, C, D, E, F, G, H, I), Rets, Wasm>

source

pub fn call( &self, A: A, B: B, C: C, D: D, E: E, F: F, G: G, H: H, I: I ) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, C, D, E, F, G, H, I, J, Rets> Func<'a, (A, B, C, D, E, F, G, H, I, J), Rets, Wasm>

source

pub fn call( &self, A: A, B: B, C: C, D: D, E: E, F: F, G: G, H: H, I: I, J: J ) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, C, D, E, F, G, H, I, J, K, Rets> Func<'a, (A, B, C, D, E, F, G, H, I, J, K), Rets, Wasm>

source

pub fn call( &self, A: A, B: B, C: C, D: D, E: E, F: F, G: G, H: H, I: I, J: J, K: K ) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, C, D, E, F, G, H, I, J, K, L, Rets> Func<'a, (A, B, C, D, E, F, G, H, I, J, K, L), Rets, Wasm>

source

pub fn call( &self, A: A, B: B, C: C, D: D, E: E, F: F, G: G, H: H, I: I, J: J, K: K, L: L ) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, C, D, E, F, G, H, I, J, K, L, M, Rets> Func<'a, (A, B, C, D, E, F, G, H, I, J, K, L, M), Rets, Wasm>

source

pub fn call( &self, A: A, B: B, C: C, D: D, E: E, F: F, G: G, H: H, I: I, J: J, K: K, L: L, M: M ) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, C, D, E, F, G, H, I, J, K, L, M, N, Rets> Func<'a, (A, B, C, D, E, F, G, H, I, J, K, L, M, N), Rets, Wasm>

source

pub fn call( &self, A: A, B: B, C: C, D: D, E: E, F: F, G: G, H: H, I: I, J: J, K: K, L: L, M: M, N: N ) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, Rets> Func<'a, (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O), Rets, Wasm>

source

pub fn call( &self, A: A, B: B, C: C, D: D, E: E, F: F, G: G, H: H, I: I, J: J, K: K, L: L, M: M, N: N, O: O ) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Rets> Func<'a, (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P), Rets, Wasm>

source

pub fn call( &self, A: A, B: B, C: C, D: D, E: E, F: F, G: G, H: H, I: I, J: J, K: K, L: L, M: M, N: N, O: O, P: P ) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, Rets> Func<'a, (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q), Rets, Wasm>

source

pub fn call( &self, A: A, B: B, C: C, D: D, E: E, F: F, G: G, H: H, I: I, J: J, K: K, L: L, M: M, N: N, O: O, P: P, Q: Q ) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, Rets> Func<'a, (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R), Rets, Wasm>

source

pub fn call( &self, A: A, B: B, C: C, D: D, E: E, F: F, G: G, H: H, I: I, J: J, K: K, L: L, M: M, N: N, O: O, P: P, Q: Q, R: R ) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, Rets> Func<'a, (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S), Rets, Wasm>

source

pub fn call( &self, A: A, B: B, C: C, D: D, E: E, F: F, G: G, H: H, I: I, J: J, K: K, L: L, M: M, N: N, O: O, P: P, Q: Q, R: R, S: S ) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, Rets> Func<'a, (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T), Rets, Wasm>

source

pub fn call( &self, A: A, B: B, C: C, D: D, E: E, F: F, G: G, H: H, I: I, J: J, K: K, L: L, M: M, N: N, O: O, P: P, Q: Q, R: R, S: S, T: T ) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, Rets> Func<'a, (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U), Rets, Wasm>

source

pub fn call( &self, A: A, B: B, C: C, D: D, E: E, F: F, G: G, H: H, I: I, J: J, K: K, L: L, M: M, N: N, O: O, P: P, Q: Q, R: R, S: S, T: T, U: U ) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, Rets> Func<'a, (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V), Rets, Wasm>

source

pub fn call( &self, A: A, B: B, C: C, D: D, E: E, F: F, G: G, H: H, I: I, J: J, K: K, L: L, M: M, N: N, O: O, P: P, Q: Q, R: R, S: S, T: T, U: U, V: V ) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, Rets> Func<'a, (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W), Rets, Wasm>

source

pub fn call( &self, A: A, B: B, C: C, D: D, E: E, F: F, G: G, H: H, I: I, J: J, K: K, L: L, M: M, N: N, O: O, P: P, Q: Q, R: R, S: S, T: T, U: U, V: V, W: W ) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Rets> Func<'a, (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X), Rets, Wasm>

source

pub fn call( &self, A: A, B: B, C: C, D: D, E: E, F: F, G: G, H: H, I: I, J: J, K: K, L: L, M: M, N: N, O: O, P: P, Q: Q, R: R, S: S, T: T, U: U, V: V, W: W, X: X ) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Rets> Func<'a, (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y), Rets, Wasm>

source

pub fn call( &self, A: A, B: B, C: C, D: D, E: E, F: F, G: G, H: H, I: I, J: J, K: K, L: L, M: M, N: N, O: O, P: P, Q: Q, R: R, S: S, T: T, U: U, V: V, W: W, X: X, Y: Y ) -> Result<Rets, RuntimeError>

Call the typed func and return results.

source§

impl<'a, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, Rets> Func<'a, (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z), Rets, Wasm>

source

pub fn call( &self, A: A, B: B, C: C, D: D, E: E, F: F, G: G, H: H, I: I, J: J, K: K, L: L, M: M, N: N, O: O, P: P, Q: Q, R: R, S: S, T: T, U: U, V: V, W: W, X: X, Y: Y, Z: Z ) -> Result<Rets, RuntimeError>

Call the typed func and return results.

Trait Implementations§

source§

impl<'a, Args: Clone, Rets: Clone, Inner: Clone + Kind> Clone for Func<'a, Args, Rets, Inner>

source§

fn clone(&self) -> Func<'a, Args, Rets, Inner>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, Args: WasmTypeList, Rets: WasmTypeList> Exportable<'a> for Func<'a, Args, Rets, Wasm>

source§

fn get_self(exports: &'a Exports, name: &str) -> ResolveResult<Self>

Implementation of how to get the export corresponding to the implementing type from an [Instance] by name.
source§

impl<'a, Args, Rets, Inner> From<Func<'a, Args, Rets, Inner>> for DynamicFunc<'a>
where Args: WasmTypeList, Rets: WasmTypeList, Inner: Kind + 'static,

source§

fn from(that: Func<'a, Args, Rets, Inner>) -> DynamicFunc<'a>

Converts to this type from the input type.
source§

impl<'a, Args, Rets, Inner> IsExport for Func<'a, Args, Rets, Inner>
where Args: WasmTypeList, Rets: WasmTypeList, Inner: Kind,

source§

fn to_export(&self) -> Export

Gets self as Export.
source§

impl<'a, Args, Rets> Send for Func<'a, Args, Rets, Wasm>

source§

impl<'a, Args, Rets> Send for Func<'a, Args, Rets, Host>

Auto Trait Implementations§

§

impl<'a, Args, Rets, Inner> Freeze for Func<'a, Args, Rets, Inner>
where Inner: Freeze,

§

impl<'a, Args = (), Rets = (), Inner = Wasm> !RefUnwindSafe for Func<'a, Args, Rets, Inner>

§

impl<'a, Args = (), Rets = (), Inner = Wasm> !Send for Func<'a, Args, Rets, Inner>

§

impl<'a, Args = (), Rets = (), Inner = Wasm> !Sync for Func<'a, Args, Rets, Inner>

§

impl<'a, Args, Rets, Inner> Unpin for Func<'a, Args, Rets, Inner>
where Inner: Unpin, Args: Unpin, Rets: Unpin,

§

impl<'a, Args = (), Rets = (), Inner = Wasm> !UnwindSafe for Func<'a, Args, Rets, Inner>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.