fn raw_napi_function_template(
    ident_n_api_fn: Ident,
    input_fn: TokenStream,
    rust_args_struct: &Vec<TokenStream>,
    rust_invocation: TokenStream,
) -> TokenStream {

    quote! {

        extern "C" fn #ident_n_api_fn(env: node_bindgen::sys::napi_env,cb_info: node_bindgen::sys::napi_callback_info) -> node_bindgen::sys::napi_value
        {
            use node_bindgen::core::TryIntoJs;
            use node_bindgen::core::IntoJs;
            use node_bindgen::core::val::JsCallbackFunction;

            #input_fn

            #(#rust_args_struct)*

            let js_env = node_bindgen::core::val::JsEnv::new(env);

            #rust_invocation
        }
    }
}
/// generate napi function invocation whether it is method or just free standing function
generate napi function invocation whether it is method or just free standing function
generate napi function invocation whether it is method or just free standing function
fn raw_napi_function_template(
    ident_n_api_fn: Ident,
    input_fn: TokenStream,
    rust_args_struct: &Vec<TokenStream>,
    rust_invocation: TokenStream,
) -> TokenStream {
    quote! {
        extern "C" fn #ident_n_api_fn(env: node_bindgen::sys::napi_env,cb_info: node_bindgen::sys::napi_callback_info) -> node_bindgen::sys::napi_value
        {
            use node_bindgen::core::TryIntoJs;
            use node_bindgen::core::IntoJs;
            use node_bindgen::core::val::JsCallbackFunction;
            #input_fn
            #(#rust_args_struct)*
            let js_env = node_bindgen::core::val::JsEnv::new(env);
            #rust_invocation
        }
    }
}
fn raw_napi_function_template ( ident_n_api_fn : Ident , input_fn : TokenStream , rust_args_struct : & Vec < TokenStream > , rust_invocation : TokenStream , ) -> TokenStream { quote ! { extern " " fn ident_n_api_fn ( env node_bindgen sys napi_env cb_info node_bindgen sys napi_callback_info ) node_bindgen sys napi_value { use node_bindgen core TryIntoJs use node_bindgen core IntoJs use node_bindgen core val JsCallbackFunction input_fn ( rust_args_struct ) let js_env node_bindgen core val JsEnv new ( env ) rust_invocation } } }
generate napi function invocation whether it is method or just free standing function
generate napi function invocation whether it is method or just free standing function
ident_n_api_fn
Ident
input_fn
TokenStream
rust_args_struct
&Vec<TokenStream>
rust_invocation
TokenStream