pub async fn run<T, S, F>(function: F) -> Result<()>
    where
        T: InputCoercible + 'static,
        S: OutputCoercible + 'static,
        F: Fn(&mut RuntimeContext, T) -> Result<S> + Send + Sync + 'static,
    {
        Self::run_inner(std::sync::Arc::new(function)).await
    }
/// `run` accepts a function from the user. `run` is an async function and returns a future which should be awaited to accept
/// user requests and execute passed function on the given input.
///
/// # Examples
///
/// ```rust,ignore
/// let function = Function::new(|_: &mut fdk::RuntimeContext, i: i32| -> Result<i32, fdk::FunctionError> {
///   Ok(i*i)
/// });
/// if let Err(e) = function.await {
///   eprintln!("{}", e);
/// }
/// ```
`run` accepts a function from the user. `run` is an async function and returns a future which should be awaited to accept
user requests and execute passed function on the given input.
` run ` accepts a function from the user . ` run ` is an async function and returns a future which should be awaited to accept user requests and execute passed function on the given input .
pub async fn run<T, S, F>(function: F) -> Result<()>
    where
        T: InputCoercible + 'static,
        S: OutputCoercible + 'static,
        F: Fn(&mut RuntimeContext, T) -> Result<S> + Send + Sync + 'static,
    {
        Self::run_inner(std::sync::Arc::new(function)).await
    }
pub async fn run < T , S , F > ( function : F ) -> Result < ( ) > where T : InputCoercible + ' static , S : OutputCoercible + ' static , F : Fn ( & mut RuntimeContext , T ) -> Result < S > + Send + Sync + ' static , { Self :: run_inner ( std :: sync :: Arc :: new ( function ) ) . await }
`run` accepts a function from the user.
` run ` accepts a function from the user .
function
F
examples
```rust,ignore
let function = Function::new(|_: &mut fdk::RuntimeContext, i: i32| -> Result {
Ok(i*i)
});
if let Err(e) = function.await {
eprintln!("{}", e);
}
```
` ` ` rust ignore let function = Function :: new ( |_ : &mut fdk :: RuntimeContext i : i32| - > Result { Ok ( i * i ) } ) ; if let Err ( e ) = function . await { eprintln! ( " {} " e ) ; } ` ` `