Michael-F-Bryan/rust-ffi-guide
소개
A guide for doing FFI using Rust
학습 및 교육측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalUsing unsafe for Fun and Profit
A guide to traversing the FFI boundary between Rust and other languages. A
rendered version is available here. This guide is centred around the
idea of building a REST client using Qt (C++) for the GUI and reqwest (Rust)
for the business logic.
Building
Building and viewing the book locally is really easy. First you need to get the source code:
$ git clone https://github.com/Michael-F-Bryan/rust-ffi-guide
Make sure you have mdbook installed:
$ cargo install mdbook
Then tell mdbook to build and serve the book:
$ mdbook serve --open
It should now be viewable at http://localhost:3000/ (if it didn't open up automatically).
To build the application itself you'll need the following installed:
- qt5
- rust (install with rustup)
- mdbook (
cargo install mdbook)
In this application we're using cmake as the build system. The
ci/test.sh script will make a build/ directory and invoke cmake to
compile and test everything.
$ ./ci/test.sh
The final application should now be at build/gui.
Alternatively, if you don't want to install all the dependencies I've created a docker image (michaelfbryan/ffi-guide) for compiling Rust and Qt.
$ docker run \
-v $(pwd):/code \
-v ~/.cargo:$HOME/.cargo \
-e CARGO_HOME=$HOME/.cargo \
--user $UID \
michaelfbryan/ffi-guide ci/test.sh
Contributing
If there's anything you feel is missing or could be improved, please create an issue. Pull requests are welcome too!
Contributors
관련 프로젝트 살펴보기
불러오는 중…