fn rust_ref(possible_type_name: Option<Ident>, index: usize) -> TokenStream {
            if let Some(type_name) = possible_type_name {
                let rust_value = rust_arg_var(index);
                let index_literal = index.to_string();
                let index_ident = LitInt::new(&index_literal, Span::call_site());
                quote! {
                    let #rust_value = js_cb.get_ref::<#type_name>(#index_ident)?;
                }
            } else {
                quote! {
                    compile_error!("not supported type ")
                }
            }
        }
/// generate expression to convert napi_value as rust ref
generate expression to convert napi_value as rust ref
generate expression to convert napi_value as rust ref
fn rust_ref(possible_type_name: Option<Ident>, index: usize) -> TokenStream {
            if let Some(type_name) = possible_type_name {
                let rust_value = rust_arg_var(index);
                let index_literal = index.to_string();
                let index_ident = LitInt::new(&index_literal, Span::call_site());
                quote! {
                    let #rust_value = js_cb.get_ref::<#type_name>(#index_ident)?;
                }
            } else {
                quote! {
                    compile_error!("not supported type ")
                }
            }
        }
fn rust_ref ( possible_type_name : Option < Ident > , index : usize ) -> TokenStream { if let Some ( type_name ) = possible_type_name { let rust_value = rust_arg_var ( index ) ; let index_literal = index . to_string ( ) ; let index_ident = LitInt :: new ( & index_literal , Span :: call_site ( ) ) ; quote ! { let rust_value js_cb get_ref type_name ( index_ident ) } } else { quote ! { compile_error ( " " ) } } }
generate expression to convert napi_value as rust ref
generate expression to convert napi_value as rust ref
possible_type_name
Option<Ident>
index
usize