pub struct AsyncFunction(/* private fields */);
Available on crate feature
async
and Linux only.Implementations§
Source§impl AsyncFunction
impl AsyncFunction
Sourcepub fn create_async_func<'data, 'inst, 'frame, 'fut, T: Send>(
ty: &FuncType,
real_fn: AsyncFn<'data, 'inst, 'frame, 'fut, T>,
data: *mut T,
cost: u64,
) -> WasmEdgeResult<Self>where
'data: 'fut,
'inst: 'fut,
'frame: 'fut,
pub fn create_async_func<'data, 'inst, 'frame, 'fut, T: Send>(
ty: &FuncType,
real_fn: AsyncFn<'data, 'inst, 'frame, 'fut, T>,
data: *mut T,
cost: u64,
) -> WasmEdgeResult<Self>where
'data: 'fut,
'inst: 'fut,
'frame: 'fut,
Creates an async host function with the given function type.
§Arguments
-
ty
- The types of the arguments and returns of the target function. -
real_fn
- The pointer to the target function. -
data
- The host context data used in this function. -
cost
- The function cost in the Statistics. Pass 0 if the calculation is not needed.
§Error
- If fail to create a Function, then WasmEdgeError::Func(FuncError::Create) is returned.
Trait Implementations§
Source§impl AsMut<Function> for AsyncFunction
impl AsMut<Function> for AsyncFunction
Auto Trait Implementations§
impl Freeze for AsyncFunction
impl RefUnwindSafe for AsyncFunction
impl Send for AsyncFunction
impl Sync for AsyncFunction
impl Unpin for AsyncFunction
impl UnwindSafe for AsyncFunction
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