pub fn async_send_call<'a, A, T>(
        &'a self,
        args: A,
    ) -> impl Future<Output = Result<T, VmError>> + Send + 'a
    where
        A: 'a + Send + Args,
        T: 'a + Send + FromValue,
    {
        let future = async move {
            let value = self.call(args)?;

            let value = match value {
                Value::Future(future) => {
                    let future = future.take()?;
                    future.await?
                }
                other => other,
            };

            T::from_value(value)
        };

        // Safety: Future is send because there is no way to call this
        // function in a manner which allows any values from the future
        // to escape outside of this future, hence it can only be
        // scheduled by one thread at a time.
        unsafe { AssertSend::new(future) }
    }
/// Perform an asynchronous call over the function which also implements
/// `Send`.
Perform an asynchronous call over the function which also implements
`Send`.
Perform an asynchronous call over the function which also implements ` Send ` .
pub fn async_send_call<'a, A, T>(
        &'a self,
        args: A,
    ) -> impl Future<Output = Result<T, VmError>> + Send + 'a
    where
        A: 'a + Send + Args,
        T: 'a + Send + FromValue,
    {
        let future = async move {
            let value = self.call(args)?;
            let value = match value {
                Value::Future(future) => {
                    let future = future.take()?;
                    future.await?
                }
                other => other,
            };
            T::from_value(value)
        };
        // Safety: Future is send because there is no way to call this
        // function in a manner which allows any values from the future
        // to escape outside of this future, hence it can only be
        // scheduled by one thread at a time.
        unsafe { AssertSend::new(future) }
    }
pub fn async_send_call < ' a , A , T > ( & ' a self , args : A , ) -> impl Future < Output = Result < T , VmError > > + Send + ' a where A : ' a + Send + Args , T : ' a + Send + FromValue , { let future = async move { let value = self . call ( args ) ? ; let value = match value { Value :: Future ( future ) => { let future = future . take ( ) ? ; future . await ? } other => other , } ; T :: from_value ( value ) } ; // Safety: Future is send because there is no way to call this // function in a manner which allows any values from the future // to escape outside of this future, hence it can only be // scheduled by one thread at a time. unsafe { AssertSend :: new ( future ) } }
Perform an asynchronous call over the function which also implements
`Send`.
Perform an asynchronous call over the function which also implements ` Send ` .
&'a self
args
A
&'a self
args
A