{"id":34753238,"url":"https://github.com/miam-miam/named-tup","last_synced_at":"2025-12-25T05:27:25.347Z","repository":{"id":40451860,"uuid":"478711839","full_name":"miam-miam/named-tup","owner":"miam-miam","description":"An implementation of named tuples in rust using the tup! macro","archived":false,"fork":false,"pushed_at":"2024-03-25T11:21:11.000Z","size":85,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-18T12:54:36.668Z","etag":null,"topics":["arguments","named","rust","tup"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/miam-miam.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}},"created_at":"2022-04-06T20:11:08.000Z","updated_at":"2024-03-27T04:37:12.000Z","dependencies_parsed_at":"2024-03-25T11:07:25.699Z","dependency_job_id":"a53734cc-b87a-4cf9-a46b-e487a97559ec","html_url":"https://github.com/miam-miam/named-tup","commit_stats":{"total_commits":37,"total_committers":2,"mean_commits":18.5,"dds":0.08108108108108103,"last_synced_commit":"39bd0ae2c2399306d472ec84c6102878156adf3b"},"previous_names":["miam-miam/named-tup"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/miam-miam/named-tup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miam-miam%2Fnamed-tup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miam-miam%2Fnamed-tup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miam-miam%2Fnamed-tup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miam-miam%2Fnamed-tup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miam-miam","download_url":"https://codeload.github.com/miam-miam/named-tup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miam-miam%2Fnamed-tup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28020651,"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","status":"online","status_checked_at":"2025-12-25T02:00:05.988Z","response_time":58,"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":["arguments","named","rust","tup"],"created_at":"2025-12-25T05:27:21.210Z","updated_at":"2025-12-25T05:27:25.338Z","avatar_url":"https://github.com/miam-miam.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Named Tups\n==================\n[\u003cimg alt=\"github\" src=\"https://img.shields.io/badge/github-8da0cb?style=for-the-badge\u0026labelColor=555555\u0026logo=github\" height=\"20\"\u003e](https://github.com/miam-miam/named-tup)\n[\u003cimg alt=\"crates.io\" src=\"https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge\u0026labelColor=555555\u0026logo=rust\" height=\"20\"\u003e](https://crates.io/crates/named-tup)\n[\u003cimg alt=\"docs.rs\" src=\"https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge\u0026labelColor=555555\u0026logoColor=white\u0026logo=data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K\" height=\"20\"\u003e](https://docs.rs/named-tup)\n\nProvides a new type called Named Tups that can be called using the [`tup!`] macro. Named Tups are structs that can\ncontain a set of named arguments, effectively they work like normal tuples that can be accessed and created using an\nactual name.\n\n[`tup!`]: https://docs.rs/named-tup/latest/named-tup/macro.tup.html\n\nThe idea of named tuples is to provide a way to quickly iterate on ideas without having to create a builder struct or\nlosing the ability to type check at compile time. Named tuples also allow the creation of default values that can\nreplace nonexistent arguments.\n\n```toml\n[dependencies]\nnamed-tup = \"0.3.1\"\n\n[build-dependencies]\ninwelling = \"0.4.0\"\n\n[package.metadata.inwelling.named-tup-derive]\n```\n\nAnd put the following in your `build.rs` file.\n\n```rust\nfn main() {\n    inwelling::register();\n}\n```\n\nIf you would prefer for this crate to not scan your project files to determine what named arguments are being used add a\nlist\nof the named tup arguments you used in your Cargo.toml like so.\n\n```toml\n[package.metadata.inwelling.named-tup-derive]\narguments = [\"count\", \"ingredients\", \"eggs\", \"price\"]\n```\n\n## Examples\n\n```rust\nuse named_tup::tup;\nlet count = 5;\n\n// This will have the type of Tup!(count: i32, ingredients: [\u0026str; 3], eggs: bool)\nlet cakes = tup!(count, ingredients: [\"milk\", \"flower\", \"sugar\"], eggs: true);\n\n// We can just add a price afterwards\nlet mut cakes = cakes + tup!(price: 3);\n// And now it has the type of Tup!(eggs: bool, ingredients: [\u0026str; 3], count: i32, price: i32)\n\n// Once the price is in the tup we can just update it!\ncakes.price = 4;\n\n// Will print tup { count: 5, eggs: true, ingredients: [\"milk\", \"flower\", \"sugar\"], price: 4 }\nprintln!(\"{cakes:?}\");\n```\n\nTo use defaults just annotate the item where you set a field\nwith [`#[tup_default]`](https://docs.rs/named-tup/latest/named-tup/attr.tup_default.html). Additionally since the\ndefaulted [`tup!`] is a type you need to convert into it by calling [`.into_tup()`] which can be accessed through\nthe [`TupInto`] trait.\n\n[`.into_tup()`]: https://docs.rs/named-tup/latest/named-tup/trait.TupInto.html\n\n[`TupInto`]: https://docs.rs/named-tup/latest/named-tup/trait.TupInto.html\n\n```rust\nuse named_tup::{tup, Tup, tup_default, TupInto};\n\nlet options = tup!(read: false, write: true);\n\n// Converts to Tup!(read: false, write: true, create: false, timeout: 5)\nopen_file(\"main.rs\", options.into_tup());\n\n#[tup_default]\nfn open_file(\n    path: \u0026str,\n    options: Tup!(\n        read: bool = true,\n        write: bool = false,\n        create: bool = false,\n        timeout: i32 = 5\n    ))\n{\n    // Open the file\n}\n```\n\nTo test the crate enable the feature `dev-test`.\n\n## Roadmap\n\n- Write some more tests\n- Serialise and Deserialise using Serde\n- Provide nice looking types for cargo doc\n\n#### License\n\n\u003csup\u003e\nLicensed under either of \u003ca href=\"LICENSE-APACHE\"\u003eApache License, Version\n2.0\u003c/a\u003e or \u003ca href=\"LICENSE-MIT\"\u003eMIT license\u003c/a\u003e at your option.\n\u003c/sup\u003e\n\n\u003cbr\u003e\n\n\u003csub\u003e\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in this crate by you, as defined in the Apache-2.0 license, shall\nbe dual licensed as above, without any additional terms or conditions.\n\u003c/sub\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiam-miam%2Fnamed-tup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiam-miam%2Fnamed-tup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiam-miam%2Fnamed-tup/lists"}