{"id":19952192,"url":"https://github.com/timluq/bytedata","last_synced_at":"2025-10-14T00:07:09.320Z","repository":{"id":192700095,"uuid":"687227884","full_name":"TimLuq/bytedata","owner":"TimLuq","description":"Represent a byte slice that is either static, borrowed, or shared.","archived":false,"fork":false,"pushed_at":"2025-05-25T12:07:24.000Z","size":374,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-25T13:21:08.592Z","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/TimLuq.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}},"created_at":"2023-09-04T23:35:26.000Z","updated_at":"2025-05-25T12:07:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"8bab5326-9d13-46d1-a7e6-f5ab6d1ce7a8","html_url":"https://github.com/TimLuq/bytedata","commit_stats":null,"previous_names":["timluq/bytedata"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/TimLuq/bytedata","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimLuq%2Fbytedata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimLuq%2Fbytedata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimLuq%2Fbytedata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimLuq%2Fbytedata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TimLuq","download_url":"https://codeload.github.com/TimLuq/bytedata/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimLuq%2Fbytedata/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017382,"owners_count":26086052,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-13T01:12:06.586Z","updated_at":"2025-10-14T00:07:09.307Z","avatar_url":"https://github.com/TimLuq.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bytedata\n\nA library for working with byte slices in a `const`-friendly manner.\n\nProvides the main types `ByteData` and `StringData` which are wrappers around byte sequences and string sequences respectively.\n\nWhen the `alloc` feature is enabled this crate provides `SharedBytes` which operates like `Arc\u003c[u8]\u003e` but with a representation that allows for `const` references to the bytes and zero-copy subslicing.\nThe `SharedBytes` type is then also added as one additional representation of `ByteData`.\n\n## Features\n\n### alloc\n\nEnables runtime allocation of byte arrays on the heap.\nThis allows for dynamic allocation of byte arrays which are exposed as `SharedBytes` and can be wrapped using `ByteData::from_shared`.\n\n### chunk\n\nThis feature is now built-in and activating it does nothing.\n\nPreviously enabled runtime representation of small byte arrays inline as `ByteChunk` which is one representation of `ByteData`.\nThis allows for optimized storage of small byte arrays that are less than or equal to 14 bytes in size.\n\n### macros\n\nExposes the `concat_bytes_static!` and `concat_str_static!` macros.\n\nThese macros allow for concatenation of static byte arrays and strings that are based on `const` values and not necessarily literals.\n\n### bytes_1\n\nEnables integration with the `bytes` crate (version `\u003e=1.7.1, \u003c2`).\nThis allows for conversion between `SharedBytes` and `bytes::Bytes` types.\nWhere possible no bytes will be cloned, which means that `ByteData::from_static` will map to `bytes::Bytes::from_static`,\nand that `\u003cbytes::Bytes as From\u003cSharedBytes\u003e\u003e::from` will return a `bytes::Bytes` object that is just a wrapper and still share the bytes as normal without any copying.\n\nThere is, however, a possibility that the internal vtable or structure of `bytes::Bytes` changes in the future or results in a different ordered ABI, in which case the zero-copy may break or segfault.\nIf this happens you can enable the feature `bytes_1_safe` which will always cause the bytes to be cloned when converting to and from `bytes::Bytes` without the use of any internal structures.\n\n### bytes_1_safe\n\nEnables integration with the `bytes` crate (version `\u003e=1.7.1, \u003c2`) in a safe manner.\nThis will cause the bytes to always be cloned when converting to and from `bytes::Bytes`.\n\nFor zero-copy conversion between `SharedBytes` and `bytes::Bytes`, use the `bytes_1` feature instead - unless it is broken.\n\n### http-body_04\n\nEnables integration with the `http-body` crate (version `\u003e=0.4.5, \u003c0.5`).\nThe trait `http_body::Body` is then implemented for `ByteData` and `SharedBytes` (if `alloc` feature is used).\n\nSince `http_body::Body` is the trait reexported as `hyper::HttpBody` in the `hyper` crate, this feature by extension also enables integration with `hyper`.\n\n### http-body_1\n\nEnables integration with the `http-body` crate (version `\u003e=1.0.0, \u003c2`).\nThe trait `http_body::Body` is then implemented for `ByteData` and `SharedBytes` (if `alloc` feature is used).\n\n### queue\n\nEnables the `ByteQueue`/`StringQueue` types which are queues of `ByteData`/`StringData` objects that can be pushed to and popped from.\nUnless the `alloc` feature is enabled, the queue will be limited to a maximum size of 8 elements.\n\n### nom_7\n\nEnables integration with the `nom` crate (version `\u003e=7, \u003c8`).\nThis allows for `ByteData`, `StringData`, `ByteQueue`, and `StringQueue` data to be parsed using `nom` parsers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimluq%2Fbytedata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimluq%2Fbytedata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimluq%2Fbytedata/lists"}