{"id":28237246,"url":"https://github.com/just-do-halee/optionee","last_synced_at":"2026-02-18T13:01:56.118Z","repository":{"id":57650041,"uuid":"399412702","full_name":"just-do-halee/optionee","owner":"just-do-halee","description":"The macro to creates option structure so easily.","archived":false,"fork":false,"pushed_at":"2021-09-04T15:35:07.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-19T00:17:57.276Z","etag":null,"topics":["configuration","data-structures","development-tools","macro","no-std","option","rust","utility"],"latest_commit_sha":null,"homepage":"","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/just-do-halee.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-24T09:46:21.000Z","updated_at":"2022-06-01T16:09:52.000Z","dependencies_parsed_at":"2022-09-08T23:50:52.098Z","dependency_job_id":null,"html_url":"https://github.com/just-do-halee/optionee","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-do-halee%2Foptionee","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-do-halee%2Foptionee/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-do-halee%2Foptionee/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-do-halee%2Foptionee/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/just-do-halee","download_url":"https://codeload.github.com/just-do-halee/optionee/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just-do-halee%2Foptionee/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259100989,"owners_count":22805182,"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":["configuration","data-structures","development-tools","macro","no-std","option","rust","utility"],"created_at":"2025-05-19T00:17:54.672Z","updated_at":"2026-02-18T13:01:56.112Z","avatar_url":"https://github.com/just-do-halee.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# optionee\n\nThe macro to create option struct easily.\u003cbr\u003e\n(no-std support)\n\n[![CI][ci-badge]][ci-url]\n[![Crates.io][crates-badge]][crates-url]\n[![Licensed][license-badge]][license-url]\n[![Twitter][twitter-badge]][twitter-url]\n\n[ci-badge]: https://github.com/just-do-halee/optionee/actions/workflows/ci.yml/badge.svg\n[crates-badge]: https://img.shields.io/crates/v/optionee.svg?labelColor=383636\n[license-badge]: https://img.shields.io/crates/l/optionee?labelColor=383636\n[twitter-badge]: https://img.shields.io/twitter/follow/do_halee?style=flat\u0026logo=twitter\u0026color=4a4646\u0026labelColor=333131\u0026label=just-do-halee\n\n[ci-url]: https://github.com/just-do-halee/optionee/actions\n[twitter-url]: https://twitter.com/do_halee\n[crates-url]: https://crates.io/crates/optionee\n[license-url]: https://github.com/just-do-halee/optionee\n| [Docs](https://docs.rs/optionee) | [Latest Note](https://github.com/just-do-halee/optionee/blob/main/CHANGELOG.md) |\n\n```toml\n[dependencies]\noptionee = \"0.2.0\"\n```\n\nor\n\n```toml\n[dependencies]\noptionee = { version = \"0.2.0\", default-features = false } # no-std(alloc)\n```\n\n## How to\n```rust\noptionee! {\n\n    InputOption {\n\n        Id {\n            min_length: u8 [\u003e] 2, \"id must be more than 3 bytes.\"\n            max_length: u8 [\u003c] 13, \"id must be less than 12 bytes.\"\n        }\n        Password {\n            encrypt: bool [=] true\n            min_length: u8 [\u003e] 5, \"psasword must be more than 6 bytes.\"\n            max_length: u8 [\u003c] 20, \"psasword must be less than 19 bytes.\"\n        }\n\n    }\n\n}\n\nlet mut id_t = InputOption.Id();\n\nlet user_input = 20;\n\nassert!(id_t.min_length.check(user_input).is_ok());\n```\n## More Examples\n```rust\norderable! {\n\n    pub struct Job {\n        id: u32[*], // mark for comparing\n        name: String,\n        salary: u16[*], // ..\n    }\n\n}\noptionee! {\n\n    pub TermOption {\n            Password {\n                max_opportunity: u8 [=] 3, \"if you don't really remember your own password, please cider o restart with --reset flag.\"\n                encrypt: bool [=] false\n                min_length: u8 [\u003e] 7, \"password must be more than 8 lengths bytes.\"\n                max_length: u8 [\u003c] 21, \"password must be less than 20 lengths bytes.\"\n            }\n    }\n    SecondPrivateOpt {\n            AnyName {\n                name: String [=] \"john\".to_string()\n                job: Job [\u003e] Job::new(0, \"sales\".to_string(), 29), \"id must be more than 1, salary 30\"\n            }\n            OldPerson {\n                name: \u0026'static str [=] \"mia\"\n                age: u8 [\u003e] 52\n            }\n\n    }\n\n}\n\nlet mut t1 = TermOption.Password().encrypt(true).min_length(3);\nt1.min_length\n    .set_error_message(Some(\"password must be more than 3 lengths bytes.\"));\n\nassert!(t1.encrypt.get_value());\nassert!(t1.min_length.check(4).is_ok());\n\nlet t2 = SecondPrivateOpt\n    .AnyName()\n    .job(Job::new(0, \"writer\".to_string(), 29));\n\nassert!(t2.name.check(\"john\".to_string()).is_ok());\nassert!(t2.job.check(Job::new(1, \"artist\".to_string(), 30)).is_ok());\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjust-do-halee%2Foptionee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjust-do-halee%2Foptionee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjust-do-halee%2Foptionee/lists"}