Macro ketos::ketos_fn [] [src]

macro_rules! ketos_fn {
    ( $scope:expr => $name:expr => fn $ident:ident
            ( $( $arg:ident : $arg_ty:ty ),* ) -> $res:ty ) => { ... };
}

Creates a foreign function that implicitly converts input arguments into Rust values and converts its result into a ketos value.

This function is added to the given scope with the given name.

fn foo(a: &str) -> Result<String, Error> { ... }

ketos_fn!{ scope => "my-fn" => fn foo(a: &str) -> String }