{"id":37469104,"url":"https://github.com/simulation-tree/types","last_synced_at":"2026-01-16T07:13:28.613Z","repository":{"id":281751033,"uuid":"916917011","full_name":"simulation-tree/types","owner":"simulation-tree","description":"Source generated type metadata available at runtime","archived":false,"fork":false,"pushed_at":"2025-09-24T03:03:04.000Z","size":165,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-24T05:16:29.634Z","etag":null,"topics":["csharp","dotnet"],"latest_commit_sha":null,"homepage":"","language":"C#","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/simulation-tree.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-15T02:06:09.000Z","updated_at":"2025-09-24T03:00:03.000Z","dependencies_parsed_at":"2025-03-11T00:31:19.469Z","dependency_job_id":"a9eef284-7a2d-492c-ad3c-47e3f6ab6dfd","html_url":"https://github.com/simulation-tree/types","commit_stats":null,"previous_names":["simulation-tree/types"],"tags_count":66,"template":false,"template_full_name":null,"purl":"pkg:github/simulation-tree/types","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simulation-tree%2Ftypes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simulation-tree%2Ftypes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simulation-tree%2Ftypes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simulation-tree%2Ftypes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simulation-tree","download_url":"https://codeload.github.com/simulation-tree/types/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simulation-tree%2Ftypes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["csharp","dotnet"],"created_at":"2026-01-16T07:13:28.550Z","updated_at":"2026-01-16T07:13:28.605Z","avatar_url":"https://github.com/simulation-tree.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Types\n\n[![Test](https://github.com/simulation-tree/types/actions/workflows/test.yml/badge.svg)](https://github.com/simulation-tree/types/actions/workflows/test.yml)\n\nAssists programming with value types in C#.\n\n### Initializing\n\nBefore types are interacted/accessed, the `MetadataRegistry` must be initialized\nby registering the types and interfaces in use:\n\n### Type layouts\n\nThese store metadata about what fields are found on a type:\n```cs\nnamespace Example\n{\n\tpublic struct Apple\n\t{\n\t\tpublic byte first;\n\t\tpublic ushort second;\n\t\tpublic Item item;\n\t}\n\n\tpublic struct Item\n\t{\n\t\tpublic uint id;\n\t}\n}\n\nTypeMetadata type = TypeMetadata.Get\u003cApple\u003e();\nAssert.That(type.FullName.ToString(), Is.EqualTo(\"Example.Apple\"));\nAssert.That(type.Size, Is.EqualTo(7));\n\nReadOnlySpan\u003cField\u003e fields = type.Fields;\nAssert.That(fields.Length, Is.EqualTo(3));\nAssert.That(fields[0].Name.ToString(), Is.EqualTo(\"first\"));\nAssert.That(fields[1].Name.ToString(), Is.EqualTo(\"second\"));\nAssert.That(fields[2].Name.ToString(), Is.EqualTo(\"item\"));\nAssert.That(fields[2].type, Is.EqualTo(TypeMetadata.Get\u003cItem\u003e()));\n```\n\n### Type banks\n\nType banks are generated for every project that references this library.\nThey contain code that registers declared types:\n```cs\nMetadataRegistry.Load\u003cCustomTypeBank\u003e();\n\npublic readonly struct CustomTypeBank : ITypeBank\n{\n    void ITypeBank.Load(Register register)\n    {\n        register.Invoke\u003cDateTime\u003e();\n    }\n}\n```\n\n### Type registry loaders\n\nThese are also generated like type banks. But differ in that they're only\ngenerated for projects with an entry point (a `static void Main()` method).\nThey load all type banks found in the project:\n```cs\nMetadataRegistryLoader.Load();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimulation-tree%2Ftypes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimulation-tree%2Ftypes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimulation-tree%2Ftypes/lists"}