{"id":13625992,"url":"https://github.com/google/rustcxx","last_synced_at":"2025-04-16T11:31:01.368Z","repository":{"id":41371463,"uuid":"68418247","full_name":"google/rustcxx","owner":"google","description":"rustcxx: Using C++ from Rust made easy","archived":true,"fork":false,"pushed_at":"2016-09-30T03:33:12.000Z","size":23,"stargazers_count":508,"open_issues_count":2,"forks_count":22,"subscribers_count":14,"default_branch":"unstable","last_synced_at":"2025-04-08T20:07:45.012Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-16T22:20:38.000Z","updated_at":"2025-02-17T14:22:07.000Z","dependencies_parsed_at":"2022-07-19T01:02:16.878Z","dependency_job_id":null,"html_url":"https://github.com/google/rustcxx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Frustcxx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Frustcxx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Frustcxx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Frustcxx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/rustcxx/tar.gz/refs/heads/unstable","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249235035,"owners_count":21235133,"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":[],"created_at":"2024-08-01T21:02:07.360Z","updated_at":"2025-04-16T11:31:01.121Z","avatar_url":"https://github.com/google.png","language":"Rust","readme":"# rustcxx: Using C++ from Rust made easy\nrustcxx is a tool allowing C++ to be used from a Rust project easily.\nIt works by allowing snippets of C++ to be included within a Rust function,\nand vice-versa.\n\n## Example\n```rust\n#![plugin(rustcxx_plugin)]\n\ncxx_inline! {\n    #include \u003cstdint.h\u003e\n    uint32_t square_it(uint32_t x) {\n        return rust![(x: u32) -\u003e u32 {\n            println!(\"Rust: Squaring {}\", x);\n            x * x\n        }];\n    }\n}\n\nlet x: u32 = 5;\nlet square = unsafe { cxx![(x: u32) -\u003e u32 {\n    std::cout \u003c\u003c \"C++: Squaring \" \u003c\u003c x \u003c\u003c std::endl;\n    square_it(x)\n}] };\n```\n\nSee [the provided example](example/main.rs) for more details.\n\n## Usage\nrustcxx requires a nightly version of the Rust compiler.\n\nAdd to your `Cargo.toml`:\n```toml\n[package]\nbuild = \"build.rs\"\n\n[dependencies.rustcxx_plugin]\ngit = \"https://github.com/google/rustcxx\"\nbranch = \"unstable\"\n\n[build-dependencies.rustcxx_codegen]\ngit = \"https://github.com/google/rustcxx\"\nbranch = \"unstable\"\n```\n\nand create a `build.rs` file containing the following:\n\n```rust\nextern crate rustcxx_codegen;\n\nfn main() {\n    rustcxx_codegen::build(\"src/main.rs\");\n}\n```\n\n## Authors\n\nThe main author is Paul Liétar.\n\n## Contributions\n\nWe gladly accept contributions via GitHub pull requests, as long as the author\nhas signed the Google Contributor License. Please see\n[CONTRIBUTING.md](CONTRIBUTING.md) for more details.\n\n### Disclaimer\n\nThis is not an official Google product (experimental or otherwise), it\nis just code that happens to be owned by Google.\n","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Frustcxx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Frustcxx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Frustcxx/lists"}