{"id":16688479,"url":"https://github.com/hoijui/codify-rs","last_synced_at":"2025-03-28T08:44:18.453Z","repository":{"id":136304856,"uuid":"570588951","full_name":"hoijui/codify-rs","owner":"hoijui","description":"Automatic Rust code generation for initializing structs and enums","archived":false,"fork":false,"pushed_at":"2024-06-02T16:32:52.000Z","size":42,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-04T09:45:57.727Z","etag":null,"topics":["library","oseg"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hoijui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2022-11-25T14:56:24.000Z","updated_at":"2024-06-02T16:32:55.000Z","dependencies_parsed_at":"2025-02-02T09:25:58.605Z","dependency_job_id":"8be07420-89ac-4d47-851d-5ed02ef5adee","html_url":"https://github.com/hoijui/codify-rs","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoijui%2Fcodify-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoijui%2Fcodify-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoijui%2Fcodify-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoijui%2Fcodify-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hoijui","download_url":"https://codeload.github.com/hoijui/codify-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245999318,"owners_count":20707554,"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":["library","oseg"],"created_at":"2024-10-12T15:43:54.379Z","updated_at":"2025-03-28T08:44:18.430Z","avatar_url":"https://github.com/hoijui.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nSPDX-FileCopyrightText: 2022 - 2024 Robin Vobruba \u003choijui.quaero@gmail.com\u003e\n\nSPDX-License-Identifier: CC0-1.0\n--\u003e\n\n# codify-rs\n\n[![License: AGPL-3.0-or-later](\n    https://img.shields.io/badge/License-AGPL--3.0--or--later-blue.svg)](\n    LICENSE.txt)\n[![REUSE status](\n    https://api.reuse.software/badge/github.com/hoijui/codify-rs)](\n    https://api.reuse.software/info/github.com/hoijui/codify-rs)\n[![Repo](\n    https://img.shields.io/badge/GitHub-green?style=flat\u0026label=Repo)](\n    https://github.com/hoijui/codify-rs)\n[![Statistics](\n    https://img.shields.io/badge/Statistics-8946FF?style=flat\u0026label=lib.rs\u0026labelColor=EEEEEE)](\n    https://lib.rs/codify_hoijui)\n[![Package Releases](\n    https://img.shields.io/crates/v/codify_hoijui.svg?color=fc8d62\u0026logo=rust)](\n    https://crates.io/crates/codify_hoijui)\n[![Documentation Releases](\n    https://img.shields.io/badge/docs.rs-codify_hoijui-66c2a5?labelColor=555555\u0026logo=docs.rs)](\n    https://docs.rs/codify_hoijui)\n[![Dependency Status](\n    https://deps.rs/repo/github/hoijui/codify-rs/status.svg)](\n    https://deps.rs/repo/github/hoijui/codify-rs)\n[![Build Status](\n    https://github.com/hoijui/codify-rs/workflows/build/badge.svg)](\n    https://github.com/hoijui/codify-rs/actions)\n\nHelps in automatic code generation at compile-time,\nfor initializing structs and enums containing data,\nwhich is to be available at runtime.\n\nThe practical use case of this,\nis to store resources/data in the binary in the most efficient form,\nso it will be ready at runtime,\nwithout having to include the data/files\nin their original, serialized, potentially innefficient form\ninto the binary.\nThis also means, the data does not have to be parsed\nat runtime/application-startup.\n\n## Usage\n\n0. Add this library to your normal and build dependencies in cargo:\n\n    ```toml\n    [dependencies]\n    codify = { version = \"0.6\", package = \"codify_hoijui\" }\n\n    [build-dependencies]\n    codify = { version = \"0.6\", package = \"codify_hoijui\" }\n    ```\n\n1. in your `build.rs`, load some data from resource files\n    into structs/enums, using serde\n2. in your `build.rs`, call `Codify::init_code()` on that data,\n    creating init code.\n3. write that code into a `$OUT_DIR/my_data_x_gen.rs` file\n4. Create a proxy source file under `src/` -\n    for example `src/my_data_x_gen.rs` -\n    which does nothing more then include the generated file:\n    `include!(concat!(env!(\"OUT_DIR\"), \"/my_data_x_gen.rs\"));`\n5. load/use `$OUT_DIR/my_data_x.rs` file at compile-time\n\n## Example\n\nFor an example usage,\nsee the [build.rs](\nhttps://github.com/hoijui/osh-dir-std-rs/blob/master/build.rs)\nfile of [osh-dir-std-rs](\nhttps://github.com/hoijui/osh-dir-std-rs/) project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoijui%2Fcodify-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoijui%2Fcodify-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoijui%2Fcodify-rs/lists"}