Macro gluon_vm::primitive

source ·
macro_rules! primitive {
    ($arg_count:tt, async fn $name:expr) => { ... };
    ($arg_count:tt, $name:expr) => { ... };
    ($arg_count:tt, $name:expr, async fn $func:expr $(, [$($params: tt)*] [$($where_: tt)*] )?) => { ... };
    ($arg_count:tt, $name:expr, $func:expr) => { ... };
    (impl $func_type:ty, $name:expr, $func:expr $(, [$($params: tt)*] [$($where_: tt)*] )?) => { ... };
}
Expand description

Creates a GluonFunction from a function implementing VMFunction

#[macro_use]
extern crate gluon_vm;
fn test(_x: i32, _y: String) -> f64 {
    panic!()
}

fn main() {
    primitive!(2, test);
}