///
/// This function allows to replace any of the parameter names when generating a c function
/// definition
///
This function allows to replace any of the parameter names when generating a c function
definition
This function allows to replace any of the parameter names when generating a c function definition
pub fn gen_c_invoke_filter<F>(&self, replace_first: FirstArgName, filter: F) -> String
    where
        F: Fn(usize, &Variable) -> Option<Cow<str>>,
    {
        let mut output = String::with_capacity(256);
        let arg_count = self.function_args.len();
        // iterater over all the parameters and run the filter
        for (i, arg) in self.function_args.iter().enumerate() {
            if i == 0 {
                match replace_first {
                    FirstArgName::Remove => continue,
                }
            }
            let filter_arg = filter(i, &arg);
            let current_arg = filter_arg.map_or_else(|| arg.name.clone().into(), |v| v);
            output.push_str(&format!("{}", current_arg));
            if i != arg_count - 1 {
                output.push_str(", ");
            }
        }
        output
    }
pub fn gen_c_invoke_filter < F > ( & self , replace_first : FirstArgName , filter : F ) -> String where F : Fn ( usize , & Variable ) -> Option < Cow < str > > , { let mut output = String :: with_capacity ( 256 ) ; let arg_count = self . function_args . len ( ) ; // iterater over all the parameters and run the filter for ( i , arg ) in self . function_args . iter ( ) . enumerate ( ) { if i == 0 { match replace_first { FirstArgName :: Remove => continue , } } let filter_arg = filter ( i , & arg ) ; let current_arg = filter_arg . map_or_else ( | | arg . name . clone ( ) . into ( ) , | v | v ) ; output . push_str ( & format ! ( " " current_arg ) ) ; if i != arg_count - 1 { output . push_str ( " " ) ; } } output }
This function allows to replace any of the parameter names when generating a c function
definition
This function allows to replace any of the parameter names when generating a c function definition
&self
replace_first
FirstArgName
filter
F