{"id":16162353,"url":"https://github.com/sunsided/ensure-uniform-type-rs","last_synced_at":"2026-02-04T04:01:54.832Z","repository":{"id":244543668,"uuid":"815576236","full_name":"sunsided/ensure-uniform-type-rs","owner":"sunsided","description":"A compile-time check to ensure that a type uses uniform types across its fields.","archived":false,"fork":false,"pushed_at":"2024-06-15T14:39:43.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-23T20:29:09.477Z","etag":null,"topics":["procedural-macro","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/ensure-uniform-type","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"eupl-1.2","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sunsided.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2024-06-15T14:16:05.000Z","updated_at":"2024-06-15T14:39:29.000Z","dependencies_parsed_at":"2024-10-27T19:17:03.137Z","dependency_job_id":"e0f966a7-dea6-4175-8d9a-62e0e0e112ba","html_url":"https://github.com/sunsided/ensure-uniform-type-rs","commit_stats":null,"previous_names":["sunsided/ensure-uniform-type-rs"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/sunsided/ensure-uniform-type-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fensure-uniform-type-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fensure-uniform-type-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fensure-uniform-type-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fensure-uniform-type-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunsided","download_url":"https://codeload.github.com/sunsided/ensure-uniform-type-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fensure-uniform-type-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29067632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-04T03:31:03.593Z","status":"ssl_error","status_checked_at":"2026-02-04T03:29:50.742Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["procedural-macro","rust"],"created_at":"2024-10-10T02:29:51.642Z","updated_at":"2026-02-04T04:01:54.795Z","avatar_url":"https://github.com/sunsided.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `#[ensure_uniform_type]`: Ensure uniform struct field types at compile-time\n\n[![Crates.io](https://img.shields.io/crates/v/ensure-uniform-type)](https://crates.io/crates/ensure-uniform-type)\n[![Crates.io](https://img.shields.io/crates/l/ensure-uniform-type)](https://crates.io/crates/ensure-uniform-type)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/sunsided/ensure-uniform-type-rs/rust.yml)\n[![docs.rs](https://img.shields.io/docsrs/ensure-uniform-type)](https://docs.rs/ensure-uniform-type/)\n\nA compile-time check to ensure that a type uses uniform types across its fields.\n\nAn example use for this macro is to ensure that a struct `#[repr(C)]` layout can\nbe correctly mapped onto a slice of the (uniform) field type.\n\n## Example\n\nAssume the following type:\n\n```rust\n#[ensure_uniform_type]\npub struct Example\u003cT\u003e\n{\n    /// First field\n    x: T,\n\n    // Different type\n    offending: u32,\n}\n```\n\nThe above would fail to compile, instead giving the error:\n\n```\nerror: Struct DifferentialDriveState has fields of different types. Expected uniform use of T, found u32 in field offending.\n  --\u003e src/differential_drive.rs:16:1\n   |\n16 | / /// A state of a differential drive robot, or differential wheeled robot.\n18 | | #[ensure_uniform_type]\n19 | | pub struct Example\u003cT\u003e\n...  |\n37 | |     offending: u32,\n38 | | }\n   | |_^\n```\n\nBy contrast, the following would compile without an error:\n\n```rust\n#[ensure_uniform_type]\npub struct Example\u003cT\u003e\n{\n    x: T,\n    not_offending: T,\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunsided%2Fensure-uniform-type-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunsided%2Fensure-uniform-type-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunsided%2Fensure-uniform-type-rs/lists"}