How to wrap a call to a FFI function that uses VarArgs in Rust?
问题 mexPrintf , just like printf , accepts a varargs list of arguments, but I don't know what the best way to wrap this is in Rust. There is a RFC for variadic generics, but what can we do today? In this example, I want to print of the number of inputs and outputs, but the wrapped function just prints garbage. Any idea how to fix this? #![allow(non_snake_case)] #![allow(unused_variables)] extern crate mex_sys; use mex_sys::mxArray; use std::ffi::CString; use std::os::raw::c_int; use std::os::raw: