Searched refs:c_ffi (Results 1 – 5 of 5) sorted by relevance
19 mod c_ffi { module28 const UNINIT: ::std::mem::MaybeUninit<c_ffi::C> = in bindgen_test_layout_C()33 ::std::mem::size_of::<c_ffi::C>() in bindgen_test_layout_C()37 ::std::mem::align_of::<c_ffi::C>() in bindgen_test_layout_C()65 const UNINIT: ::std::mem::MaybeUninit<c_ffi::D> = in bindgen_test_layout_D()70 ::std::mem::size_of::<c_ffi::D>() in bindgen_test_layout_D()74 ::std::mem::align_of::<c_ffi::D>() in bindgen_test_layout_D()81 impl Default for c_ffi::D {
19 mod c_ffi { module27 const UNINIT: ::std::mem::MaybeUninit<c_ffi::Foo2> = ::std::mem::MaybeUninit::uninit(); in bindgen_test_layout_foo()31 ::std::mem::size_of::<c_ffi::Foo2>() in bindgen_test_layout_foo()35 ::std::mem::align_of::<c_ffi::Foo2>() in bindgen_test_layout_foo()42 impl Default for c_ffi::Foo2 {
18 mod c_ffi { module26 unsafe { c_ffi::FuncAAddB(a, b) } in add_two_numbers_in_c()38 c_ffi::SayHello(c_world); in main()
49 3. 添加文件main.rs,就可以在Rust侧通过c_ffi实现对C侧的接口调用。注意Rust侧调用的不安全接口需要使用unsafe封装。54 mod c_ffi {62 unsafe { c_ffi::FuncAAddB(a, b) }74 c_ffi::SayHello(c_world);
49 3. Create the **main.rs** file to call C interfaces through c_ffi using Rust. Note that insecure in…54 mod c_ffi {62 unsafe { c_ffi::FuncAAddB(a, b) }74 c_ffi::SayHello(c_world);