{"id":34904705,"url":"https://github.com/gwllx/typestate-enum","last_synced_at":"2026-05-24T02:31:25.360Z","repository":{"id":205569875,"uuid":"714546547","full_name":"gwllx/typestate-enum","owner":"gwllx","description":"A Rust macro to help build simple Typestate APIs.","archived":false,"fork":false,"pushed_at":"2023-11-05T10:49:26.000Z","size":1076,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-27T19:49:24.742Z","etag":null,"topics":["rust","rust-macros","typestate"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/typestate-enum","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/gwllx.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2023-11-05T07:05:16.000Z","updated_at":"2025-07-10T20:32:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"cd5bf155-b0ca-4db7-8f2a-fb5b2607ee6e","html_url":"https://github.com/gwllx/typestate-enum","commit_stats":null,"previous_names":["gwllx/type_enum","gwllx/typestate-enum"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gwllx/typestate-enum","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gwllx%2Ftypestate-enum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gwllx%2Ftypestate-enum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gwllx%2Ftypestate-enum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gwllx%2Ftypestate-enum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gwllx","download_url":"https://codeload.github.com/gwllx/typestate-enum/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gwllx%2Ftypestate-enum/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33419550,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T22:14:44.296Z","status":"online","status_checked_at":"2026-05-24T02:00:06.296Z","response_time":57,"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":["rust","rust-macros","typestate"],"created_at":"2025-12-26T09:57:00.719Z","updated_at":"2026-05-24T02:31:25.355Z","avatar_url":"https://github.com/gwllx.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# typestate-enum\n\nA Rust macro to help build simple Typestate APIs.\n\n## Example\n\nThe following example defines a trait ``State`` and 3 zero-sized types which\nimplement it: ``Ready``, ``Working``, and ``Complete``. The types can then be\nused to build simple Typestate APIs.\n\n```rust\nuse typestate_enum::typestate_enum;\nuse std::marker::PhantomData;\n\ntypestate_enum! {\n    pub State {\n        Ready,\n        Working,\n        Complete\n    }\n}\n\nstruct Action\u003cS: State\u003e(PhantomData\u003cS\u003e);\n\nimpl\u003cS: State\u003e Action\u003cS\u003e {\n    fn new() -\u003e Self {\n        Action::\u003cS\u003e(PhantomData)\n    }\n}\n\nimpl Action\u003cReady\u003e {\n    fn start_work(self) -\u003e Action\u003cWorking\u003e {\n        Action::new()\n    }\n}\n\nimpl Action\u003cWorking\u003e {\n    fn complete_work(self) -\u003e Action\u003cComplete\u003e {\n        Action::new()\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgwllx%2Ftypestate-enum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgwllx%2Ftypestate-enum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgwllx%2Ftypestate-enum/lists"}