{"id":16162380,"url":"https://github.com/sunsided/feature-gate","last_synced_at":"2025-06-15T04:08:28.877Z","repository":{"id":170676200,"uuid":"646908064","full_name":"sunsided/feature-gate","owner":"sunsided","description":"A simple macro for feature-gating modules and types","archived":false,"fork":false,"pushed_at":"2023-05-29T16:07:59.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T03:47:51.704Z","etag":null,"topics":["procedural-macro","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/feature-gate","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":"2023-05-29T16:03:07.000Z","updated_at":"2023-05-29T16:07:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"afc84f2e-2763-4638-a3d8-a35dfcb6f74f","html_url":"https://github.com/sunsided/feature-gate","commit_stats":null,"previous_names":["sunsided/feature-gate"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sunsided/feature-gate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Ffeature-gate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Ffeature-gate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Ffeature-gate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Ffeature-gate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunsided","download_url":"https://codeload.github.com/sunsided/feature-gate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Ffeature-gate/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259919461,"owners_count":22932073,"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":["procedural-macro","rust"],"created_at":"2024-10-10T02:29:55.893Z","updated_at":"2025-06-15T04:08:28.858Z","avatar_url":"https://github.com/sunsided.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple documented feature gates\n\nThis crates provides the `feature_gate` and `feature_gate_ex`\nmacros for simple `#[cfg(feature = \"...\")]` macros that are properly\ndocumented on docs.rs.\n\n## Stable Rust\n\nNote that for it to work properly on stable Rust, the following needs to be\nadded to `Cargo.toml` for the time being (see [Metadata for custom builds](https://docs.rs/about/metadata)):\n\n```toml\n[package.metadata.docs.rs]\nall-features = true\nrustdoc-args = [\"--cfg\", \"docsrs\"]\n```\n\n## Example\n\nThe `feature_gate` macro allows the specification of a single feature:\n\n```rust\nuse feature_gate::feature_gate;\n\n#[feature_gate(\"test\")]\nstruct FeatureGated;\n\n#[test]\nfn it_works() {\n    let _ = FeatureGated {};\n}\n```\n\nThe `feature_gate_ex` macro allows the specification of a complex set of requirements:\n\n```rust\nuse feature_gate::feature_gate_ex;\n\n#[feature_gate_ex(any(test, feature = \"test\"))]\nstruct FeatureGated;\n\n#[test]\nfn it_works() {\n    let _ = FeatureGated {};\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunsided%2Ffeature-gate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunsided%2Ffeature-gate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunsided%2Ffeature-gate/lists"}