Rust2Go is a project that assists users in calling Golang from Rust. The goal of this project is to provide a simple and efficient way for Rust developers to leverage the powerful features of Golang.
- Sync and async calls from Rust to Golang
- Efficient data exchange
- Simple API design
- Define the structs and calling interfaces in restricted Rust syntax, and include generated code in the same file.
- Generate golang code with
rust2go-cli --src src/user.rs --dst go/gen.go
- Write a
build.rs
for you project. - You can then use generated implementation to call golang in your Rust project!
For detailed example, please checkout the example project.
- IDL(in rust) parse
- Go code generation
- Build script helper
- Basic data types and convertion generation
- Rust impl generation
- Future and basic synchronization primitives used
- More complicated data types support
- Support user passing references
- More elegant code generation implementation
- Better build cache control
- Golang interface support(separate user code from generated code)
- Dynamic linking support
- Golang helper library
- Support calling rust from golang
This project is inspired by fcplug.