{"id":20989892,"url":"https://github.com/iddm/introspection","last_synced_at":"2025-05-14T18:32:18.740Z","repository":{"id":62441011,"uuid":"83656285","full_name":"iddm/introspection","owner":"iddm","description":"A rust introspection procedural macro.","archived":false,"fork":false,"pushed_at":"2023-12-05T18:54:57.000Z","size":13,"stargazers_count":18,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-14T14:46:08.433Z","etag":null,"topics":["introspection","procedural-macros","rust"],"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/iddm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":"iddm"}},"created_at":"2017-03-02T08:54:43.000Z","updated_at":"2024-10-10T23:45:17.000Z","dependencies_parsed_at":"2024-01-05T17:44:25.225Z","dependency_job_id":"93b3e7e8-5c19-4b5a-9276-55395fd043f9","html_url":"https://github.com/iddm/introspection","commit_stats":null,"previous_names":["iddm/introspection","vityafx/introspection"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iddm%2Fintrospection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iddm%2Fintrospection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iddm%2Fintrospection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iddm%2Fintrospection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iddm","download_url":"https://codeload.github.com/iddm/introspection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225305772,"owners_count":17453446,"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":["introspection","procedural-macros","rust"],"created_at":"2024-11-19T06:26:35.739Z","updated_at":"2024-11-19T06:26:36.602Z","avatar_url":"https://github.com/iddm.png","language":"Rust","funding_links":["https://github.com/sponsors/iddm"],"categories":[],"sub_categories":[],"readme":"# introspection\nA rust introspection procedural macro.\n\n\n[![](https://meritbadge.herokuapp.com/introspection)](https://crates.io/crates/introspection) [![](https://travis-ci.org/iddm/introspection.svg?branch=master)](https://travis-ci.org/iddm/introspection)\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)\n\n\n## What does it do?\n\nIt simply converts code from compile stage (from `syn` crate) to simplier structs. Works for `struct`s and `enum`s.\n You may obtain this information through a [`Introspection`](https://github.com/iddm/introspection/blob/master/introspection/src/lib.rs) trait.\n  \n\n## Usage\n\n1. Add `introspection` as dependency in your `Cargo.toml`:\n\n ```toml\n [dependencies]\n introspection-derive = \"0.1\"\n introspection = \"0.1\"\n ```\n\n2. Create a struct or enum:\n\n ```rust\n #[macro_use]\n extern crate introspection_derive;\n extern crate introspection;\n \n \n #[derive(Introspection)]\n struct FrenchToast {\n     private_field: u64,\n     pub public_field: u8,\n }\n\n ```\n\n3. Use it:\n\n ```rust\n fn main() {\n    use introspection::{ Introspection };\n    println!(\"Introspection: {:?}\", FrenchToast::introspection());\n }\n ```\n \n4. See the results:\n\n```\n      Running `target/debug/introspection-test`\nIntrospection: IntrospectionInfo { ident: \"FrenchToast\", visibility: Inherited, entity_type: Struct, fields: [\"private_field\", \"public_field\"] }\n```\n \nP.S. Personally I doubt this crate will help someone because it is impossible to do a lot of interesting and useful stuff from procedural macro at this moment unfortunately (rustc v1.15).\n \n## License\n\nThis project is [licensed under the MIT license](https://github.com/iddm/introspection/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiddm%2Fintrospection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiddm%2Fintrospection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiddm%2Fintrospection/lists"}