{"id":23112951,"url":"https://github.com/vbfox/stidgen.rs","last_synced_at":"2025-07-04T15:38:30.709Z","repository":{"id":57668659,"uuid":"291352538","full_name":"vbfox/stidgen.rs","owner":"vbfox","description":" Generate Strongly Typed Id types in Rust","archived":false,"fork":false,"pushed_at":"2022-07-08T20:55:34.000Z","size":67,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-21T22:55:33.456Z","etag":null,"topics":["derive","id","macro","rust"],"latest_commit_sha":null,"homepage":"","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/vbfox.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-29T21:33:04.000Z","updated_at":"2024-04-30T08:54:04.000Z","dependencies_parsed_at":"2022-08-27T03:25:04.121Z","dependency_job_id":null,"html_url":"https://github.com/vbfox/stidgen.rs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbfox%2Fstidgen.rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbfox%2Fstidgen.rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbfox%2Fstidgen.rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbfox%2Fstidgen.rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vbfox","download_url":"https://codeload.github.com/vbfox/stidgen.rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230051559,"owners_count":18165252,"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":["derive","id","macro","rust"],"created_at":"2024-12-17T02:21:12.727Z","updated_at":"2024-12-17T02:21:13.264Z","avatar_url":"https://github.com/vbfox.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Strongly Typed ID types macro\n\nA macro to simplify usage of srongly type ID types instead of plain\n`String`, `u64` or `Guid` in Rust codebases.\n\n```rust\nuse stidgen::{Id, id};\n\n#[id]\npub struct UserId(String);\n\n#[id(NoDefaults, Format, Debug)]\npub struct UserId(u64);\n```\n\nWhile the `derive` macro can already be used to achieve most of what this\nmacro proposes using it has the following advantages:\n\n- It's simplier to use for well known types, simply add `#[id]` to your struct\n- The defaults provide a lot of blanket implementations that might be missed when doing it manually\n- Some features provided don't have corresponding derive macros (`AsBytes`, `AsRef`, `Borrow`)\n- All trivial functions are marked inline\n\n### Settings\n\n- `Defaults`/`NoDefaults`: Enable or disable defaults for known types\n- `Clone`/`NoClone`: Enable or disable deriving [`std::clone::Clone`](https://doc.rust-lang.org/std/clone/trait.Clone.html)\n- `Hash`/`NoHash`: Enable or disable deriving [`std::hash::Hash`](https://doc.rust-lang.org/std/hash/trait.Hash.html)\n- `PartialEq`/`NoPartialEq`: Enable or disable deriving [`std::cmp::PartialEq`](https://doc.rust-lang.org/std/cmp/trait.PartialEq.html)\n- `Eq`/`NoEq`: Enable or disable deriving [`std::cmp::Eq`](https://doc.rust-lang.org/std/cmp/trait.Eq.html)\n- `PartialOrd`/`NoPartialOrd`: Enable or disable deriving [`std::cmp::PartialOrd`](https://doc.rust-lang.org/std/cmp/trait.PartialOrd.html)\n- `Ord`/`NoOrd`: Enable or disable deriving [`std::cmp::Ord`](https://doc.rust-lang.org/std/cmp/trait.Ord.html)\n- `Display`/`NoDisplay`: Enable or disable deriving [`std::fmt::Display`](https://doc.rust-lang.org/std/fmt/trait.Display.html) and adding a `to_string` method\n- `Debug`/`NoDebug`: Enable or disable deriving [`std::fmt::Debug`](https://doc.rust-lang.org/std/fmt/trait.Debug.html)\n- `AsBytes`/`NoAsBytes`: Enable or disable deriving `std::convert::AsRef\u003c[u8]\u003e` and adding a `as_bytes` method\n- `Borrow`/`NoBorrow`: Enable or disable deriving [`std::borrow::Borrow`](https://doc.rust-lang.org/std/borrow/trait.Borrow.html)\n- `AsRef`/`NoAsRef`: Enable or disable deriving [`std::convert::AsRef`](https://doc.rust-lang.org/std/convert/trait.AsRef.html)\n\n### Default types\n\nFor unknown types all features are disabled by default but some types like `String` have smart defaults.\n\n```rust\n#[id(Clone, Hash, PartialEq, Eq, PartialOrd, Ord, Display, ToString, Debug, AsBytes, ...)]\npub struct Id(String);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvbfox%2Fstidgen.rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvbfox%2Fstidgen.rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvbfox%2Fstidgen.rs/lists"}