{"id":16373122,"url":"https://github.com/bbqsrc/nova","last_synced_at":"2025-03-23T03:32:31.234Z","repository":{"id":57645883,"uuid":"380839903","full_name":"bbqsrc/nova","owner":"bbqsrc","description":"Newtype macros for commonly reused types in Rust.","archived":false,"fork":false,"pushed_at":"2024-11-19T10:32:04.000Z","size":39,"stargazers_count":4,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T17:05:48.030Z","etag":null,"topics":["dataclass","integers","macro","newtype","rust","string","uuid","vector"],"latest_commit_sha":null,"homepage":"https://docs.rs/nova/","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/bbqsrc.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}},"created_at":"2021-06-27T21:20:01.000Z","updated_at":"2024-11-19T10:32:33.000Z","dependencies_parsed_at":"2022-09-07T16:03:47.218Z","dependency_job_id":null,"html_url":"https://github.com/bbqsrc/nova","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbqsrc%2Fnova","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbqsrc%2Fnova/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbqsrc%2Fnova/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbqsrc%2Fnova/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbqsrc","download_url":"https://codeload.github.com/bbqsrc/nova/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245052619,"owners_count":20553161,"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":["dataclass","integers","macro","newtype","rust","string","uuid","vector"],"created_at":"2024-10-11T03:13:25.654Z","updated_at":"2025-03-23T03:32:30.899Z","avatar_url":"https://github.com/bbqsrc.png","language":"Rust","readme":"# nova\n\n[![Documentation](https://docs.rs/nova/badge.svg)](https://docs.rs/nova)\n\nCreate newtypes with great convenience.\n\nAll types generated by the following macros implement `Debug`, `Clone`, `Eq`, `PartialEq`, `Ord`, `PartialOrd` \nand `Hash`. For `Copy` types, the newtype also implements `Copy`.\n\n## Usage\n\n```toml\n[dependencies]\nnova = \"0.4\"\n```\n\n### Example\n\n```rust\nuse nova::newtype;\n\n#[newtype(serde, borrow = \"str\")]\npub type Meow = String;\n\n#[newtype(new, copy)]\npub(crate) type SpecialUuid = uuid::Uuid;\n\nfn example() {\n    let meow = Meow(\"this is a string\".to_string());\n    let special_uuid = SpecialUuid::from(uuid::Uuid::new_v4());\n\n    // Get inner:\n    let inner = special_uuid.into_inner();\n}\n\n```\n\n## Supported attributes\n\n### Crate compatibility attributes\n\n- **serde**: enables support for the `serde` attribute to derive `Serialize` and `Deserialize` for newtypes.\n- **sqlx**: enables support for the `sqlx` attribute to derive `sqlx::Type` for newtypes.\n- **async_graphql**: enables support for the `async_graphql` attribute to implement `Scalar` for newtypes.\n\n### Generation attributes\n\n- **copy**: derives `Copy` on the newtype.\n- **opaque**: disables generating a `Deref` and `into_inner` functions to create an opaque type.\n- **borrow = \"\u0026lt;type\u0026gt;\"**: sets the type to be used for the `Deref` implementation, if needed.\n- **new**: create default construction `new` function and `From` implementation.\n- **derive(...)**: replace the default derives for the newtype with the provided list. Same syntax as the normal `#[derive(...)]` attribute.\n\n## License\n\nThis project is licensed under either of\n\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or \u003chttp://opensource.org/licenses/MIT\u003e)\n\nat your option.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbqsrc%2Fnova","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbqsrc%2Fnova","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbqsrc%2Fnova/lists"}