{"id":22080007,"url":"https://github.com/naokim03/derive_newtype","last_synced_at":"2025-03-23T20:44:00.310Z","repository":{"id":143644238,"uuid":"488045165","full_name":"NaokiM03/derive_newtype","owner":"NaokiM03","description":"This derive macro provides Deref, DerefMut, and From for the newtype pattern.","archived":false,"fork":false,"pushed_at":"2022-05-03T13:35:08.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T04:19:47.175Z","etag":null,"topics":["crate","derive","macro","newtype"],"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/NaokiM03.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-03T01:38:55.000Z","updated_at":"2022-05-03T13:38:33.000Z","dependencies_parsed_at":"2023-05-29T17:15:30.347Z","dependency_job_id":null,"html_url":"https://github.com/NaokiM03/derive_newtype","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaokiM03%2Fderive_newtype","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaokiM03%2Fderive_newtype/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaokiM03%2Fderive_newtype/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaokiM03%2Fderive_newtype/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NaokiM03","download_url":"https://codeload.github.com/NaokiM03/derive_newtype/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245168817,"owners_count":20571799,"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":["crate","derive","macro","newtype"],"created_at":"2024-11-30T23:11:53.864Z","updated_at":"2025-03-23T20:44:00.279Z","avatar_url":"https://github.com/NaokiM03.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# derive_newtype\n\n## About\n\nThis derive macro provides `Deref`, `DerefMut`, and `From` for the newtype pattern.\n\nA similar crate exists but has not been updated.\n\n## Notice\n\nThis library has no plans to add further functionality at this time. Only version updates of dependent libraries will be followed.\n\n## How to use\n\n```rust\nuse derive_newtype::Newtype;\n\n#[derive(Newtype)]\nstruct Foo(u8);\n```\n\nThis macro will generate the following code:\n\n```rust\nimpl core::ops::Deref for Foo {\n    type Target = u8;\n    fn deref(\u0026self) -\u003e \u0026Self::Target {\n        \u0026self.0\n    }\n}\nimpl core::ops::DerefMut for Foo {\n    fn deref_mut(\u0026mut self) -\u003e \u0026mut Self::Target {\n        \u0026mut self.0\n    }\n}\nimpl From\u003cu8\u003e for Foo {        \n    fn from(inner: u8) -\u003e Foo {\n        Foo(inner)\n    }\n}\n```\n\n## License\n\nderive_newtype is released under the MIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaokim03%2Fderive_newtype","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaokim03%2Fderive_newtype","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaokim03%2Fderive_newtype/lists"}