fn rust_value(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_value::<#type_name>(#index_ident)?;
                }
            } else {
                quote! {
                    compile_error!("not supported type ")
                }
            }
        }
// generate expression to convert napi value to rust value from callback
generate expression to convert napi value to rust value from callback
generate expression to convert napi value to rust value from callback
fn rust_value(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_value::<#type_name>(#index_ident)?;
                }
            } else {
                quote! {
                    compile_error!("not supported type ")
                }
            }
        }
fn rust_value ( 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_value type_name ( index_ident ) } } else { quote ! { compile_error ( " " ) } } }
generate expression to convert napi value to rust value from callback
generate expression to convert napi value to rust value from callback
possible_type_name
Option<Ident>
index
usize