{"id":13683481,"url":"https://github.com/Michael-F-Bryan/rust-ffi-guide","last_synced_at":"2025-04-30T13:30:56.052Z","repository":{"id":56346201,"uuid":"82185803","full_name":"Michael-F-Bryan/rust-ffi-guide","owner":"Michael-F-Bryan","description":"A guide for doing FFI using Rust","archived":false,"fork":false,"pushed_at":"2021-06-13T16:33:26.000Z","size":1552,"stargazers_count":287,"open_issues_count":18,"forks_count":17,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-09T16:19:36.084Z","etag":null,"topics":["ffi","rust","tutorial"],"latest_commit_sha":null,"homepage":"https://michael-f-bryan.github.io/rust-ffi-guide/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Michael-F-Bryan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-16T13:53:10.000Z","updated_at":"2025-02-17T13:46:06.000Z","dependencies_parsed_at":"2022-08-15T17:00:57.116Z","dependency_job_id":null,"html_url":"https://github.com/Michael-F-Bryan/rust-ffi-guide","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Michael-F-Bryan%2Frust-ffi-guide","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Michael-F-Bryan%2Frust-ffi-guide/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Michael-F-Bryan%2Frust-ffi-guide/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Michael-F-Bryan%2Frust-ffi-guide/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Michael-F-Bryan","download_url":"https://codeload.github.com/Michael-F-Bryan/rust-ffi-guide/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251712877,"owners_count":21631455,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ffi","rust","tutorial"],"created_at":"2024-08-02T13:02:12.710Z","updated_at":"2025-04-30T13:30:55.661Z","avatar_url":"https://github.com/Michael-F-Bryan.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Using `unsafe` for Fun and Profit\n\n[![Build Status](https://travis-ci.org/Michael-F-Bryan/rust-ffi-guide.svg?branch=master)](https://travis-ci.org/Michael-F-Bryan/rust-ffi-guide)\n[![Creative Commons Zero License](https://img.shields.io/github/license/Michael-F-Bryan/rust-ffi-guide.svg)](https://creativecommons.org/publicdomain/zero/1.0/deed.en)\n\n\nA guide to traversing the FFI boundary between Rust and other languages. A\nrendered version is available [here][gh-pages]. This guide is centred around the\nidea of building a REST client using `Qt` (C++) for the GUI and `reqwest` (Rust)\nfor the business logic.\n\n\n## Building\n\nBuilding and viewing the book locally is really easy. First you need to get the\nsource code:\n\n```bash\n$ git clone https://github.com/Michael-F-Bryan/rust-ffi-guide\n```\n\nMake sure you have `mdbook` installed:\n\n```bash\n$ cargo install mdbook\n```\n\nThen tell `mdbook` to build and serve the book:\n\n```bash\n$ mdbook serve --open\n```\n\nIt should now be viewable at [http://localhost:3000/](http://localhost:3000/) \n(if it didn't open up automatically).\n\nTo build the application itself you'll need the following installed:\n\n- qt5\n- rust (install with [rustup])\n- mdbook (`cargo install mdbook`)\n\nIn this application we're using `cmake` as the build system. The\n`ci/test.sh` script will make a `build/` directory and invoke `cmake` to \ncompile and test everything.\n\n```\n$ ./ci/test.sh\n```\n\nThe final application should now be at `build/gui`.\n\nAlternatively, if you don't want to install all the dependencies I've created a\ndocker image ([michaelfbryan/ffi-guide][docker]) for compiling Rust and Qt.\n\n```\n$ docker run \\\n    -v $(pwd):/code \\\n    -v ~/.cargo:$HOME/.cargo \\\n    -e CARGO_HOME=$HOME/.cargo \\\n    --user $UID \\\n    michaelfbryan/ffi-guide ci/test.sh\n```\n\n\n## Contributing\n\nIf there's anything you feel is missing or could be\nimproved, please [create an issue][issues]. Pull requests are welcome too!\n\n\n### Contributors\n\n- [Michael-F-Bryan](https://github.com/Michael-F-Bryan)\n- [gurgalex](https://github.com/gurgalex)\n- [adeschamps](https://github.com/adeschamps)\n\n\n[gh-pages]: https://michael-f-bryan.github.io/rust-ffi-guide/\n[issues]: https://github.com/Michael-F-Bryan/rust-ffi-guide/issues/new\n[rustup]: https://rustup.rs/\n[docker]: https://hub.docker.com/r/michaelfbryan/ffi-guide/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMichael-F-Bryan%2Frust-ffi-guide","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMichael-F-Bryan%2Frust-ffi-guide","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMichael-F-Bryan%2Frust-ffi-guide/lists"}