{"id":21320192,"url":"https://github.com/nercury/typedef-rs","last_synced_at":"2025-07-09T05:04:06.332Z","repository":{"id":24257501,"uuid":"27651220","full_name":"Nercury/typedef-rs","owner":"Nercury","description":"Rust library to identify or compare types, as well as print type names.","archived":false,"fork":false,"pushed_at":"2017-10-24T18:59:04.000Z","size":557,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-01T00:52:44.997Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Nercury.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":"2014-12-06T22:26:13.000Z","updated_at":"2017-07-07T10:06:54.000Z","dependencies_parsed_at":"2022-08-22T14:31:08.578Z","dependency_job_id":null,"html_url":"https://github.com/Nercury/typedef-rs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Nercury/typedef-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nercury%2Ftypedef-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nercury%2Ftypedef-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nercury%2Ftypedef-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nercury%2Ftypedef-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nercury","download_url":"https://codeload.github.com/Nercury/typedef-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nercury%2Ftypedef-rs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264396610,"owners_count":23601540,"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":[],"created_at":"2024-11-21T19:45:44.157Z","updated_at":"2025-07-09T05:04:06.313Z","avatar_url":"https://github.com/Nercury.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TypeDef\n\nIdentify or compare types, get or print type names.\n\nSince Rust 1.0, this library can only display type names on nightly Rust. \nOn stable rust, it falls back to gobbledygook (type identifier) instead of a nice name.\n\nTo activate the nice names instead of gobbledygook, configure this library with \n`features = [\"nightly\"]` configuration parameter.\n\n[![Build Status](https://travis-ci.org/Nercury/typedef-rs.svg?branch=master)](https://travis-ci.org/Nercury/typedef-rs)\n\n## Quick example\n\n```rust\nuse typedef::{ TypeDef };\n\n// type name querying:\n\nassert!(TypeDef::name_of::\u003ci64\u003e() == \"i64\");\n\n// and also type value:\n\nlet typedef = TypeDef::of::\u003ci64\u003e();\n\nassert!(typedef.is::\u003ci64\u003e());\nassert!(typedef.get_str() == \"i64\");\nassert!(typedef == TypeDef::of::\u003ci64\u003e());\n\nprintln!(\"type is {:?}\", typedef);\n```\n\n## Usage\n\nPut this in your `Cargo.toml`:\n\n```toml\n[dependencies]\ntypedef = \"0.3\"\n```\n\nConfigure nightly feature on you crate so that cargo argument `--features=\"nightly\"` would enable\n`nightly` feature on the typedef crate:\n\n```toml\n[features]\nnightly = [\"typedef/nightly\"]\n```\n\nAnd this in your crate root:\n\n```rust\nextern crate typedef;\n```\n\n## Resources\n\n- [Use `TypeId` if you do not need type names](http://doc.rust-lang.org/std/intrinsics/struct.TypeId.html)\n- [Full `TypeDef` documentation](http://nercury.github.io/typedef-rs)\n- [`TypeDef` on crates.io](https://crates.io/crates/typedef)\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally\nsubmitted for inclusion in the work by you, as defined in the Apache-2.0\nlicense, shall be dual licensed as above, without any additional terms or\nconditions.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnercury%2Ftypedef-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnercury%2Ftypedef-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnercury%2Ftypedef-rs/lists"}