cxx
cxx copied to clipboard
How to add can_frame to the bindings?
Hello! I would like to use can_frame in my bindings. I need to use my rust's library in C++. I need to create can_frame in rust and pass it to C++. How to do it? Can you help me?
use cxx::{CxxString, CxxVector,};
#[cxx::bridge]
mod ffi {
unsafe extern "C++" {
include!("<can.h>");
type can_frame;
}
#[namespace = "rust_part"]
extern "Rust"
{
unsafe fn encode_frame(frame_id: &CxxString) -> can_frame;
}
}