{"id":20744898,"url":"https://github.com/calebzulawski/arch-types","last_synced_at":"2026-04-24T14:31:16.088Z","repository":{"id":88675076,"uuid":"262940900","full_name":"calebzulawski/arch-types","owner":"calebzulawski","description":"CPU feature detection types for Rust","archived":false,"fork":false,"pushed_at":"2020-05-25T16:54:59.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-18T02:40:40.126Z","etag":null,"topics":["cpu-detection","cpu-features","cpuid","simd"],"latest_commit_sha":null,"homepage":"","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/calebzulawski.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-11T04:46:43.000Z","updated_at":"2020-05-25T16:55:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"64084a5e-d65d-4136-b3fb-2531b5114d54","html_url":"https://github.com/calebzulawski/arch-types","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/calebzulawski%2Farch-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calebzulawski%2Farch-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calebzulawski%2Farch-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calebzulawski%2Farch-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/calebzulawski","download_url":"https://codeload.github.com/calebzulawski/arch-types/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243039610,"owners_count":20226131,"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":["cpu-detection","cpu-features","cpuid","simd"],"created_at":"2024-11-17T07:17:37.685Z","updated_at":"2026-04-24T14:31:09.053Z","avatar_url":"https://github.com/calebzulawski.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"arch-types\n==========\n[![Build Status](https://github.com/calebzulawski/arch-types/workflows/Build/badge.svg?branch=master)](https://github.com/calebzulawski/arch-types/actions)\n![Rustc Version 1.34+](https://img.shields.io/badge/rustc-1.34+-lightgray.svg)\n\nType-level CPU feature detection using a tag dispatch model.\n\nThe following example uses a type that proves AVX support to make an AVX function safe to call:\n```rust\nuse arch_types::{impl_features, new_features_type, Features};\n\n#[cfg(any(target_arch = \"x86\", target_arch = \"x86_64\"))]\n#[target_feature(enable = \"avx\")]\nunsafe fn foo_unsafe() {\n    println!(\"hello from AVX!\");\n}\n\n#[cfg(any(target_arch = \"x86\", target_arch = \"x86_64\"))]\nfn foo_safe(_: impl_features!(\"avx\")) {\n    unsafe { foo_unsafe() } // the trait bound ensures we support AVX\n}\n\n#[cfg(any(target_arch = \"x86\", target_arch = \"x86_64\"))]\nfn main() {\n    new_features_type! { Avx =\u003e \"avx\" }\n    if let Some(handle) = Avx::new() {\n        foo_safe(handle)\n    }\n}\n```\n\nThe following fails to compile due to missing AVX support:\n```rust\n#[cfg(any(target_arch = \"x86\", target_arch = \"x86_64\"))]\nfn main() {\n    new_features_type! { NotAvx =\u003e \"sse\" }\n    if let Some(handle) = NotAvx::new() {\n        foo_safe(handle)\n    }\n}\n```\n## License\narch-types is distributed under the terms of both the MIT license and the Apache License (Version 2.0).\n\nSee [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalebzulawski%2Farch-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalebzulawski%2Farch-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalebzulawski%2Farch-types/lists"}