{"id":23816644,"url":"https://github.com/magnet/config-jam-rs","last_synced_at":"2026-06-20T19:32:09.711Z","repository":{"id":97413333,"uuid":"170740389","full_name":"magnet/config-jam-rs","owner":"magnet","description":"Typesafe, ergonomic config for Rust","archived":false,"fork":false,"pushed_at":"2019-02-15T14:43:55.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-21T20:46:03.108Z","etag":null,"topics":["config","configuration","macro","meta-programming","rust"],"latest_commit_sha":null,"homepage":null,"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/magnet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2019-02-14T18:42:31.000Z","updated_at":"2019-02-15T14:43:57.000Z","dependencies_parsed_at":"2024-03-14T12:31:54.293Z","dependency_job_id":null,"html_url":"https://github.com/magnet/config-jam-rs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/magnet/config-jam-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnet%2Fconfig-jam-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnet%2Fconfig-jam-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnet%2Fconfig-jam-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnet%2Fconfig-jam-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magnet","download_url":"https://codeload.github.com/magnet/config-jam-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnet%2Fconfig-jam-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34583589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["config","configuration","macro","meta-programming","rust"],"created_at":"2025-01-02T04:31:29.793Z","updated_at":"2026-06-20T19:32:09.695Z","avatar_url":"https://github.com/magnet.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# config-jam\nWORK-IN-PROGRESS, RELEASE SOON :)\n## Typesafe, ergonomic config for Rust\n\n```rust\nuse config_jam::{config, OverrideWith};\n\nconfig! {\n#[derive(Debug, Default, Clone, OverrideWith, serde::Serialize, serde::Deserialize)]\n#[field_derive(Debug, Clone, serde::Serialize, serde::Deserialize)]\npub config Foo {\n    pub barval: String = \"Foo\".into(),\n    pub test: u32 = 42,\n    pub required: u64\n}\n\n// We can add several configs\n#[derive(Debug, Default)]\n#[field_derive(Debug)]\npub config Bar {\n    pub single: \u0026'static str = \"Bar\",\n    // And we can have complex initializers\n    pub multiple: Vec\u003cu32\u003e = vec![42, 38]\n}\n}\n\nfn main() {\n    let mut foo_base = Foo::default();\n\n    println!(\"Foo Base:: {:#?}\", foo_base.get());\n\n    let foo_toml = Foo {\n        barval: Some(\"Bar\".to_string().into()), // TODO improve this\n        test: None,\n        required: 9000,\n    };\n\n    println!(\"Foo TOML:: {:#?}\", foo_toml.get());\n\n    foo_base.override_with(foo_toml);\n\n    println!(\"Foo Base overriden by Foo TOML:: {:#?}\", foo_base.get());\n\n    let foo_env = Foo {\n        barval: Some(\"Bazinga!\".to_string().into()), // TODO improve this\n        test: Some(98.into()),\n        required: 9999,\n    };\n\n    println!(\"Foo ENV {:#?}\", foo_env.get());\n\n    foo_base.override_with(foo_env);\n\n    println!(\n        \"Foo Base overriden by Foo TOML then Foo ENV:: {:#?}\",\n        foo_base.get()\n    );\n\n    // You can now use any field you like\n    let some_val = dbg!(foo_base.get().barval);\n    // do_something with some_val!\n\n    let bar = Bar::default();\n    // Now read-only access with the same structure!\n    let bar = bar.get();\n\n    let s = dbg!(bar.single);\n    let m = dbg!(bar.multiple);\n}\n```\n\nThis program prints the following output:\n\n```\nFoo Base:: FooView {\n    barval: \"Foo\",\n    test: 42,\n    required: 0\n}\nFoo TOML:: FooView {\n    barval: \"Bar\",\n    test: 42,\n    required: 9000\n}\nFoo Base overriden by Foo TOML:: FooView {\n    barval: \"Bar\",\n    test: 42,\n    required: 9000\n}\nFoo ENV FooView {\n    barval: \"Bazinga!\",\n    test: 98,\n    required: 9999\n}\nFoo Base overriden by Foo TOML then Foo ENV:: FooView {\n    barval: \"Bazinga!\",\n    test: 98,\n    required: 9999\n}\n[src/main.rs:57] foo_base.get().barval = \"Bazinga!\"\n[src/main.rs:65] bar.single = \"Bar\"\n[src/main.rs:66] bar.multiple = [\n    42,\n    38\n]\n```\n\n## Required Rust version\n\nConfig Jam works on `Rust` stable.\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally\nsubmitted for inclusion in the work by you, as defined in the Apache-2.0\nlicense, shall be dual licensed as above, without any additional terms or\nconditions.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagnet%2Fconfig-jam-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagnet%2Fconfig-jam-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagnet%2Fconfig-jam-rs/lists"}