{"id":13875918,"url":"https://github.com/carllerche/codegen","last_synced_at":"2025-05-15T16:09:54.573Z","repository":{"id":41523134,"uuid":"113229168","full_name":"carllerche/codegen","owner":"carllerche","description":"A Rust library providing a builder API to generate Rust code.","archived":false,"fork":false,"pushed_at":"2024-06-25T11:58:22.000Z","size":876,"stargazers_count":252,"open_issues_count":19,"forks_count":66,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-04T00:06:31.291Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/carllerche.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-05T20:23:49.000Z","updated_at":"2025-04-01T07:10:29.000Z","dependencies_parsed_at":"2024-10-13T13:20:40.830Z","dependency_job_id":null,"html_url":"https://github.com/carllerche/codegen","commit_stats":{"total_commits":37,"total_committers":10,"mean_commits":3.7,"dds":0.6216216216216216,"last_synced_commit":"726ea011a5a8fbfc4cf888913a88fa3cd3523bb9"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carllerche%2Fcodegen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carllerche%2Fcodegen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carllerche%2Fcodegen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carllerche%2Fcodegen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carllerche","download_url":"https://codeload.github.com/carllerche/codegen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248489035,"owners_count":21112486,"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-06T06:00:49.867Z","updated_at":"2025-04-11T22:28:14.521Z","avatar_url":"https://github.com/carllerche.png","language":"Rust","readme":"# Codegen\n\nProvides an builder API to assist in generating Rust code.\n\n[![Build Status](https://travis-ci.org/carllerche/codegen.svg?branch=master)](https://travis-ci.org/carllerche/codegen)\n\nMore information about this crate can be found in the [crate documentation][dox]\n\n[dox]: https://docs.rs/codegen/0.1.3/codegen/\n\n## Installation\n\nTo use `codegen`, first add this to your `Cargo.toml`:\n\n```toml\n[dependencies]\ncodegen = \"0.1.3\"\n```\n\nNext, add this to your crate:\n\n```rust\nextern crate codegen;\n```\n\n## Usage\n\n1) Create a `Scope` instance.\n2) Use the builder API to add elements to the scope.\n3) Call `Scope::to_string()` to get the generated code.\n\nFor example:\n\n```rust\nuse codegen::Scope;\n\nlet mut scope = Scope::new();\n\nscope.new_struct(\"Foo\")\n    .derive(\"Debug\")\n    .field(\"one\", \"usize\")\n    .field(\"two\", \"String\");\n\nprintln!(\"{}\", scope.to_string());\n```\n\n## Non-goals\n\n`codegen` will not attempt to perform anything beyond basic formatting. For\nimproved formatting, the generated code can be passed to `rustfmt`.\n\n## License\n\nThis project is licensed under the [MIT license](LICENSE).\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in `codegen` by you, shall be licensed as MIT, without any\nadditional terms or conditions.\n","funding_links":[],"categories":["Rust","others"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarllerche%2Fcodegen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarllerche%2Fcodegen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarllerche%2Fcodegen/lists"}