Skip to content

le0zh/c_to_rust_ffi_demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FFI demo for C call Rust

MacOS only for now.

Build the lib

sh build.sh

Run the demo

cd demo
sh run.sh
================= c → rust demo===================
[0]hello from rust
[1]got string from rust: hello rust!
[2]got int from rust: 4
[3]got bool from rust: false
[4]got struct from rust:  name as my_rstruct
[4]got struct from rust:  value as int 42
[rust] do http request url http://awesome.service.api with timeout 5000
[5]got ffi_http_request status: 200
[rust] do biz logic with 1 ....
[c]OnStateChangedCallback is called: 201

About

FFI demo for C call Rust

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published