{"id":25128172,"url":"https://github.com/ickk/inspect","last_synced_at":"2025-04-02T21:16:41.213Z","repository":{"id":275533954,"uuid":"925938913","full_name":"ickk/inspect","owner":"ickk","description":"inspect descriptions of types at run-time","archived":false,"fork":false,"pushed_at":"2025-02-03T05:50:34.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-02-03T06:30:49.053Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ickk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-02-02T05:44:08.000Z","updated_at":"2025-02-03T05:50:37.000Z","dependencies_parsed_at":"2025-02-03T06:31:02.242Z","dependency_job_id":"34479335-e980-414a-bfbb-c0cecfa33d6a","html_url":"https://github.com/ickk/inspect","commit_stats":null,"previous_names":["ickk/inspect"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ickk%2Finspect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ickk%2Finspect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ickk%2Finspect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ickk%2Finspect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ickk","download_url":"https://codeload.github.com/ickk/inspect/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246892844,"owners_count":20850850,"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":"2025-02-08T11:38:58.066Z","updated_at":"2025-04-02T21:16:41.191Z","avatar_url":"https://github.com/ickk.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e *Do you think God stays in heaven because he too lives in fear of what he's\n\u003e created?* ~ Spy Kids 2\n\n`inspect`\n---------\n\nAn experiment collecting information about types to be queried at run-time.\n\nThis can work for types containing references, and even those with non-static\nlifetime parameters; In the latter case the `TypeId` collected corresponds to\nthe `'static` version of the given type.\n\nFor now it is implemented for common primitive types, including numerics,\npointers, references, slices, tuples (up to *8-tuples*) and some types from\n`std` like `Vec`, `PhantomData`, `Option`, `Result`, \u0026c.\n\n`TypeInfo` contains the type_name, size, align, and `TypeId` of a types. For\nstructs the names, offsets, and types of fields are available. For types like\n`Vec\u003cT\u003e`, `Option\u003cT\u003e`, `[T]` the type info of the generic item is available.\n\n```rust\nuse ::inspect::TypeInfo;\n\n#[derive(TypeInfo)]\nstruct MyStruct\u003cT\u003e(Option\u003cChild\u003cT\u003e\u003e);\n#[derive(TypeInfo)]\nstruct Child\u003cT\u003e(usize, Option\u003cBox\u003cstr\u003e\u003e, Box\u003c[T]\u003e);\n\nlet type_info = TypeInfo::of::\u003cMyStruct\u003cu32\u003e\u003e();\nassert_eq!(\n  format!(\"size: {:?}, align: {:?}\", type_info.size(), type_info.align()),\n  \"size: Some(40), align: Some(8)\"\n);\nassert_eq!(\n  format!(\"{type_info:#}\"),\n\"MyStruct\u003cu32\u003e(\n    Option\u003cChild\u003cu32\u003e(\n        usize,\n        Option\u003cBox\u003cstr\u003e\u003e,\n        Box\u003c[u32]\u003e,\n    )\u003e,\n)\",\n  );\n\nlet type_info = TypeInfo::of::\u003c[\u0026'static Vec\u003cu8\u003e]\u003e();\nassert_eq!(\n  format!(\"size: {:?}, align: {:?}\", type_info.size(), type_info.align()),\n  \"size: None, align: None\",\n);\nassert_eq!(\n  format!(\"{type_info:#}\"),\n  \"[\u0026Vec\u003cu8\u003e]\",\n);\n\nuse ::core::marker::PhantomData;\nlet type_info = TypeInfo::of::\u003cPhantomData\u003cVec\u003cusize\u003e\u003e\u003e();\nassert_eq!(\n  format!(\"size: {:?}, align: {:?}\", type_info.size(), type_info.align()),\n  \"size: Some(0), align: Some(1)\",\n);\nassert_eq!(\n  format!(\"{type_info:#}\"),\n  \"PhantomData\u003cVec\u003cusize\u003e\u003e\",\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fickk%2Finspect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fickk%2Finspect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fickk%2Finspect/lists"}