In Rust, could you instead use a templated struct wrapping a function pointer along with #[repr(C)]?