{"id":16065276,"url":"https://github.com/shnatsel/current_platform","last_synced_at":"2025-03-16T08:32:09.399Z","repository":{"id":57614846,"uuid":"475968397","full_name":"Shnatsel/current_platform","owner":"Shnatsel","description":"Find out what platform your code is running on from Rust","archived":false,"fork":false,"pushed_at":"2022-04-13T23:42:49.000Z","size":20,"stargazers_count":32,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-27T05:51:29.017Z","etag":null,"topics":["compile-time","platform","rust"],"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/Shnatsel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-30T16:44:39.000Z","updated_at":"2024-11-16T07:40:10.000Z","dependencies_parsed_at":"2022-09-11T01:41:48.476Z","dependency_job_id":null,"html_url":"https://github.com/Shnatsel/current_platform","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/Shnatsel%2Fcurrent_platform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shnatsel%2Fcurrent_platform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shnatsel%2Fcurrent_platform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shnatsel%2Fcurrent_platform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shnatsel","download_url":"https://codeload.github.com/Shnatsel/current_platform/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806070,"owners_count":20350775,"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":["compile-time","platform","rust"],"created_at":"2024-10-09T05:12:10.346Z","updated_at":"2025-03-16T08:32:09.138Z","avatar_url":"https://github.com/Shnatsel.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## `current_platform`\n\n**Find out what platform your code is running on, in Rust:**\n\n```rust\nuse current_platform::CURRENT_PLATFORM;\n\nfn main() {\n    println!(\"Running on {}\", CURRENT_PLATFORM);\n}\n```\n\nwill print `Running on x86_64-unknown-linux-gnu` on desktop Linux.\n\nPlatform information is resolved **at compile time,**\nbased on the platform for which your code is compiled.\nIt incurs **zero runtime cost.**\n\nThe target triple for the platform where the code was compiled is also included\nas `COMPILED_ON`. It is only different from the `CURRENT_PLATFORM` if the code\nwas [cross-compiled.](https://en.wikipedia.org/wiki/Cross_compiler)\nThis is rarely useful; if in doubt, use `CURRENT_PLATFORM`.\n\nThis crate is intentionally minimal and only provides the target triples.\nYou can find out other properties of the platform using crates such as\n[`platforms`](https://docs.rs/platforms/latest/platforms/)\n (auto-generated, always up to date) or\n[`target-lexicon`](https://docs.rs/target-lexicon/latest/target_lexicon/)\n(more detailed but may be missing newly added or obscure platforms).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshnatsel%2Fcurrent_platform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshnatsel%2Fcurrent_platform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshnatsel%2Fcurrent_platform/lists"}