Skip to content

San7o/rust-c-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-c-wrapper

This project showcases how to crate a wrapper of a C library in Rust.

An example C library is present in libhello. Its Rust bindings and safe wrappers all live in src. The build system (build.rs) first builds the C library statically, then it generates Rust types and functions from C using bindgen and finally it builds the wrapper library.

Example program src/main.rs:

$ cargo run
[C] Hello! I put some values in the struct
[Rust] HelloStruct: HelloStruct { x: 7, y: 'b', message: "HELLO" }

About

This project showcases how to crate a wrapper of a C library in Rust.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors