{"id":15762398,"url":"https://github.com/williamvenner/fn_type_alias","last_synced_at":"2025-03-31T09:41:46.102Z","repository":{"id":57631316,"uuid":"409767931","full_name":"WilliamVenner/fn_type_alias","owner":"WilliamVenner","description":"✨ A proc attribute macro that generates a type alias with the given identifier for the attributed function","archived":false,"fork":false,"pushed_at":"2021-09-23T23:23:15.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-11T11:34:01.819Z","etag":null,"topics":["alias","macro","proc-macro","proc-macro-attributes","rust","type"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/fn_type_alias","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/WilliamVenner.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}},"created_at":"2021-09-23T23:07:30.000Z","updated_at":"2021-09-26T23:26:06.000Z","dependencies_parsed_at":"2022-09-16T17:10:27.570Z","dependency_job_id":null,"html_url":"https://github.com/WilliamVenner/fn_type_alias","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/WilliamVenner%2Ffn_type_alias","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Ffn_type_alias/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Ffn_type_alias/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Ffn_type_alias/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WilliamVenner","download_url":"https://codeload.github.com/WilliamVenner/fn_type_alias/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246450425,"owners_count":20779406,"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":["alias","macro","proc-macro","proc-macro-attributes","rust","type"],"created_at":"2024-10-04T11:09:00.808Z","updated_at":"2025-03-31T09:41:46.084Z","avatar_url":"https://github.com/WilliamVenner.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![crates.io](https://img.shields.io/crates/v/fn_type_alias.svg)](https://crates.io/crates/fn_type_alias)\n\n# ✨ `fn_type_alias`\n\nA proc attribute macro that generates a type alias with the given identifier for the attributed function.\n\n## Example\n\n```rust\n#[macro_use]\nextern crate fn_type_alias;\n\n#[type_alias(HelloWorldFn)] // The type alias will inherit its visibility from the function\npub(super) fn hello_world() {\n    println!(\"hello world!\");\n}\n\n#[type_alias(pub(crate), HelloWorldFn)] // The type alias will be pub(crate), but the function will be pub\npub fn hello_world() {\n    println!(\"hello world!\");\n}\n```\n\n## Use Case\n\nThis macro is well suited for conditional compilation. For example, using the [`fn_abi`](https://crates.io/crates/fn_abi) macro:\n\n```rust\n#[macro_use]\nextern crate fn_type_alias;\n\n#[macro_use]\nextern crate fn_abi;\n\n#[abi(\n    linux32 = \"C\",\n    linux64 = \"C\",\n    win32 = \"thiscall\",\n    win64 = \"stdcall\"\n)]\n#[type_alias(HelloWorldFn)]\npub extern fn hello_world() {\n    println!(\"hello world!\");\n}\n\n// Expands to when building for Windows 64-bit:\npub type HelloWorldFn = extern \"stdcall\" fn();\npub extern \"stdcall\" fn hello_world() {\n    println!(\"hello world!\");\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamvenner%2Ffn_type_alias","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilliamvenner%2Ffn_type_alias","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamvenner%2Ffn_type_alias/lists"}