{"id":15370286,"url":"https://github.com/jedisct1/zig-bounded-array","last_synced_at":"2025-02-27T18:31:21.428Z","repository":{"id":208680124,"uuid":"722213961","full_name":"jedisct1/zig-bounded-array","owner":"jedisct1","description":"BoundedArray module for Zig.","archived":true,"fork":false,"pushed_at":"2025-02-11T13:51:33.000Z","size":10,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-23T10:25:23.269Z","etag":null,"topics":["array","arrayvec","bounded","boundedarray","tinyvec","zig","zig-lib","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/jedisct1.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-22T17:18:28.000Z","updated_at":"2025-02-22T18:59:02.000Z","dependencies_parsed_at":"2024-05-21T14:51:51.489Z","dependency_job_id":"ab27e8fe-c766-400c-b18e-4beeed1f0d32","html_url":"https://github.com/jedisct1/zig-bounded-array","commit_stats":null,"previous_names":["jedisct1/zig-bounded-array"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedisct1%2Fzig-bounded-array","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedisct1%2Fzig-bounded-array/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedisct1%2Fzig-bounded-array/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedisct1%2Fzig-bounded-array/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jedisct1","download_url":"https://codeload.github.com/jedisct1/zig-bounded-array/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241044605,"owners_count":19899537,"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":["array","arrayvec","bounded","boundedarray","tinyvec","zig","zig-lib","zig-package","ziglang"],"created_at":"2024-10-01T13:40:46.018Z","updated_at":"2025-02-27T18:31:21.423Z","avatar_url":"https://github.com/jedisct1.png","language":"Zig","readme":"# BoundedArray for Zig\n\nA `BoundedArray` is a structure containing a fixed-size array, as well as the length currently being used.\n\nIt can be used as a variable-length array that can be freely resized up to the size of the backing array.\n\nIf you're looking for a Zig equivalent to Rust's super useful `ArrayVec`, this is it.\n\nIt is useful to pass around small arrays whose exact size is only known at runtime, but whose maximum size is known at comptime, without requiring an `Allocator`.\n\nBounded arrays are easier and safer to use than maintaining buffers and active lengths separately, or involving structures that include pointers.\n\nThey can also be safely copied like any value, as they don't use any internal pointers.\n\n```zig\nvar actual_size = 32;\nvar a = try BoundedArray(u8, 64).init(actual_size);\nvar slice = a.slice(); // a slice of the 64-byte array\nvar a_clone = a; // creates a copy - the structure doesn't use any internal pointers\n```\n\n# Update: archived.\n\nThe main point of that fork was to keep the length being a `usize`,\nbecause returning a different type was a footgun (adding lengths, in\nparticular, could easily trigger an overflow).\n\nHowever, that change was eventually\n[reverted](https://github.com/ziglang/zig/commit/85747b266aac8a2ff7fea4a4b18f722133544ad7),\nso applications should just go back to using the type from the standard library.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjedisct1%2Fzig-bounded-array","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjedisct1%2Fzig-bounded-array","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjedisct1%2Fzig-bounded-array/lists"}