{"id":15136241,"url":"https://github.com/kofituo/rifgen","last_synced_at":"2025-10-23T11:31:24.726Z","repository":{"id":43694326,"uuid":"406756781","full_name":"Kofituo/rifgen","owner":"Kofituo","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-13T18:08:45.000Z","size":8870,"stargazers_count":37,"open_issues_count":2,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-30T18:05:55.609Z","etag":null,"topics":["c","code-generation","codegen","flapigen","java","jni","rust","swig"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kofituo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-09-15T12:34:04.000Z","updated_at":"2024-08-11T11:37:53.000Z","dependencies_parsed_at":"2024-01-20T18:01:33.844Z","dependency_job_id":"44937583-7ea8-4535-9896-448f2a12bd67","html_url":"https://github.com/Kofituo/rifgen","commit_stats":{"total_commits":76,"total_committers":3,"mean_commits":"25.333333333333332","dds":0.1578947368421053,"last_synced_commit":"396dd9fcfe36cefd480f669601b6dac0cddcf94d"},"previous_names":["kofituo/rust_interface_file_generator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kofituo%2Frifgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kofituo%2Frifgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kofituo%2Frifgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kofituo%2Frifgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kofituo","download_url":"https://codeload.github.com/Kofituo/rifgen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237821537,"owners_count":19371780,"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":["c","code-generation","codegen","flapigen","java","jni","rust","swig"],"created_at":"2024-09-26T06:04:40.029Z","updated_at":"2025-10-23T11:31:24.363Z","avatar_url":"https://github.com/Kofituo.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rifgen\n\n![Rust](https://img.shields.io/badge/rust-%23000000.svg?style=for-the-badge\u0026logo=rust\u0026logoColor=white)\n[![doc](https://img.shields.io/crates/v/rifgen.svg)](https://crates.io/crates/rifgen)\n[![Rust Documentation](https://img.shields.io/badge/api-rustdoc-blue.svg)](https://docs.rs/rifgen/)\n[![donate](https://badgen.net/badge/Donate/Hubtel/orange)](https://p.hbtl.co/tHBHce)\n\nProgram for translating libraries written in Rust to interface files. It works\nwith [flapigen](https://github.com/Dushistov/flapigen-rs). \u003cb\u003eFor instructions on how to integrate with your project,\nclick [here](https://docs.rs/rifgen/). This crate was initially [rust_interface_file_generator](https://crates.io/crates/rust_interface_file_generator/)\n\n\u003c/b\u003eSuppose you have the following Rust code:\n\n```rust\nstruct Foo {\n    data: i32\n}\n\nimpl Foo {\n    fn new(val: i32) -\u003e Foo {\n        Foo { data: val }\n    }\n\n    fn f(\u0026self, a: i32, b: i32) -\u003e i32 {\n        self.data + a + b\n    }\n\n    fn set_field(\u0026mut self, v: i32) {\n        self.data = v;\n    }\n}\n```\n\nUsing [flapigen](https://github.com/Dushistov/flapigen-rs), you'd have to write an interface file similar to\n\n```rust\nforeign_class!(class Foo {\n    self_type Foo;\n    constructor Foo::new(_: i32) -\u003e Foo;\n    fn Foo::set_field(\u0026mut self, _: i32);\n    fn Foo::f(\u0026self, _: i32, _: i32) -\u003e i32;\n});\n```\n\nin order to write in Java something like this:\n\n```Java\nFoo foo=new Foo(5);\n        int res=foo.f(1,2);\n        assert res==8;\n```\n\nor in C++ something like this:\n\n```C++\nFoo foo(5);\nint res = foo.f(1, 2);\nassert(res == 8);\n```\n\n\u003ch3\u003eThis module generates the interface file, so you can focus more time on your code\n\nOther Features:\u003c/h3\u003e\u003ch4\u003e\n\n✅ Fast and easy to use\n\n✅ Specify style of the resulting code i.e. Whether CamelCase or snake_case\n\n✅ Works, with `structs`, `enums`, `trait`\n\n✅ You don't have to worry about the \"order\" in which code in the interface has to be\n\n## Users Guide\n\n\u003cb\u003e[Read the `rifgen` users guide here!](https://docs.rs/rifgen/)\n\n[View on crates.io](https://crates.io/crates/rifgen)\n\n## Contact Me\n\nIf you'd like to contact me to help with any project whatsoever, you can [reach me on Upwork](https://www.upwork.com/freelancers/~0196d30a485de56f48)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkofituo%2Frifgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkofituo%2Frifgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkofituo%2Frifgen/lists"}