{"id":14990806,"url":"https://github.com/ikskuh/any-pointer","last_synced_at":"2025-06-11T18:03:50.511Z","repository":{"id":45501991,"uuid":"424982278","full_name":"ikskuh/any-pointer","owner":"ikskuh","description":"A type erasure library for Zig that is meant to be eventually upstreamed to std","archived":false,"fork":false,"pushed_at":"2025-03-19T15:51:16.000Z","size":30,"stargazers_count":38,"open_issues_count":4,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T03:29:09.383Z","etag":null,"topics":["zig","zig-package","ziglang"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/ikskuh.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,"zenodo":null},"funding":{"github":"MasterQ32"}},"created_at":"2021-11-05T14:45:56.000Z","updated_at":"2025-03-25T16:42:18.000Z","dependencies_parsed_at":"2025-04-12T03:28:45.957Z","dependency_job_id":"ae9ae2ab-a382-4225-a02c-218efabfc2d6","html_url":"https://github.com/ikskuh/any-pointer","commit_stats":{"total_commits":18,"total_committers":4,"mean_commits":4.5,"dds":0.6111111111111112,"last_synced_commit":"15f40d9feddbb2b063b8817e3f248189558acf31"},"previous_names":["ikskuh/any-pointer","masterq32/any-pointer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ikskuh/any-pointer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikskuh%2Fany-pointer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikskuh%2Fany-pointer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikskuh%2Fany-pointer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikskuh%2Fany-pointer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ikskuh","download_url":"https://codeload.github.com/ikskuh/any-pointer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikskuh%2Fany-pointer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259311612,"owners_count":22838755,"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":["zig","zig-package","ziglang"],"created_at":"2024-09-24T14:20:53.242Z","updated_at":"2025-06-11T18:03:50.492Z","avatar_url":"https://github.com/ikskuh.png","language":"Zig","funding_links":["https://github.com/sponsors/MasterQ32"],"categories":[],"sub_categories":[],"readme":"# any-pointer type erasure\n\nThis package provides a single file `any-pointer.zig` that implements a type-erased pointer for Zig.\n\nThis pointer type supports three functions `make`, `cast` and `isNull` and exports the symbol `null_pointer`.\n\n```zig\nconst AnyPointer = @import(\"any-pointer\").AnyPointer;\n\nvar i: u32 = 0;\n\nconst erased = AnyPointer.make(*u32, \u0026i);\n\nconst ptr = erased.cast(*u32);\n\nptr.* = 42;\n\nstd.debug.assert(i == 42);\n```\n\nIn safe modes (`Debug` and `ReleaseSafe`) `cast` will type-check the pointer and might `@panic` when a type confusion would happen.\n\n## Usage\n\nJust add a package pointing to `any-pointer.zig` to your project.\n\nThe package will export three types:\n\n- `SafePointer`, which will provide type checking and panics in safe modes.\n- `UnsafePointer`, which will not provide type checking and will only have the size of a single pointer.\n- `AnyPointer`, which will be `SafePointer` in safe modes and `UnsafePointer` in unsafe modes.\n\nIn addition to `make`, `cast` and `isNull`, `SafePointer` also has the function `tryCast` which works like `cast`, but will return an optional.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fikskuh%2Fany-pointer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fikskuh%2Fany-pointer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fikskuh%2Fany-pointer/lists"}