fn as_arg_token_stream(&self, index: &mut usize,ctx: &mut FunctionContext) -> TokenStream {
        match self {
            Self::Path(t) => {
                let output = t.as_arg_token_stream(*index);
                *index = *index + 1;
                output
            },
            Self::Ref(t) => {
                let output = t.as_arg_token_stream(*index);
                *index = *index + 1;
                output
            }
            Self::Closure(t) => {
                let arg_name = rust_arg_var(*index);
                let output = t.as_arg_token_stream(*index, &arg_name,ctx);
                *index = *index + 1;
                output
            }
            Self::JSCallback(_) => {
                let js_cb = Ident::new("js_cb", Span::call_site());
                quote! { &#js_cb, }
            }
        }
    }
/// generate code as part of invoking rust function
/// for normal argument, it is just variable
/// other may like closure may need to convert to rust closure
/// for example,
generate code as part of invoking rust function
for normal argument, it is just variable
other may like closure may need to convert to rust closure
for example.
generate code as part of invoking rust function for normal argument it is just variable other may like closure may need to convert to rust closure for example .
fn as_arg_token_stream(&self, index: &mut usize,ctx: &mut FunctionContext) -> TokenStream {
        match self {
            Self::Path(t) => {
                let output = t.as_arg_token_stream(*index);
                *index = *index + 1;
                output
            },
            Self::Ref(t) => {
                let output = t.as_arg_token_stream(*index);
                *index = *index + 1;
                output
            }
            Self::Closure(t) => {
                let arg_name = rust_arg_var(*index);
                let output = t.as_arg_token_stream(*index, &arg_name,ctx);
                *index = *index + 1;
                output
            }
            Self::JSCallback(_) => {
                let js_cb = Ident::new("js_cb", Span::call_site());
                quote! { &#js_cb, }
            }
        }
    }
fn as_arg_token_stream ( & self , index : & mut usize , ctx : & mut FunctionContext ) -> TokenStream { match self { Self :: Path ( t ) => { let output = t . as_arg_token_stream ( * index ) ; * index = * index + 1 ; output } , Self :: Ref ( t ) => { let output = t . as_arg_token_stream ( * index ) ; * index = * index + 1 ; output } Self :: Closure ( t ) => { let arg_name = rust_arg_var ( * index ) ; let output = t . as_arg_token_stream ( * index , & arg_name , ctx ) ; * index = * index + 1 ; output } Self :: JSCallback ( _ ) => { let js_cb = Ident :: new ( " " , Span :: call_site ( ) ) ; quote ! { js_cb } } } }
generate code as part of invoking rust function
for normal argument, it is just variable
other may like closure may need to convert to rust closure
for example,
generate code as part of invoking rust function for normal argument it is just variable other may like closure may need to convert to rust closure for example
&self
index
&mut usize
ctx
&mut FunctionContext