{"id":26130584,"url":"https://github.com/emeraldpay/byte-array-struct","last_synced_at":"2025-10-05T08:24:04.364Z","repository":{"id":62438668,"uuid":"237687229","full_name":"emeraldpay/byte-array-struct","owner":"emeraldpay","description":"Rust macro to create a byte-array backed struct","archived":false,"fork":false,"pushed_at":"2020-09-02T02:19:31.000Z","size":16,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T10:13:00.738Z","etag":null,"topics":["rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emeraldpay.png","metadata":{"files":{"readme":"README.adoc","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}},"created_at":"2020-02-01T22:33:46.000Z","updated_at":"2022-12-14T04:54:05.000Z","dependencies_parsed_at":"2022-11-01T21:48:00.403Z","dependency_job_id":null,"html_url":"https://github.com/emeraldpay/byte-array-struct","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emeraldpay%2Fbyte-array-struct","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emeraldpay%2Fbyte-array-struct/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emeraldpay%2Fbyte-array-struct/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emeraldpay%2Fbyte-array-struct/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emeraldpay","download_url":"https://codeload.github.com/emeraldpay/byte-array-struct/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248768257,"owners_count":21158607,"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":["rust"],"created_at":"2025-03-10T20:51:53.596Z","updated_at":"2025-10-05T08:24:04.301Z","avatar_url":"https://github.com/emeraldpay.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Byte Array Struct type for Rust\n\nimage:https://travis-ci.org/emeraldpay/byte-array-struct.svg?branch=master[\"Travis CI\", link=\"https://travis-ci.org/emeraldpay/byte-array-struct\"]\nimage:https://img.shields.io/crates/v/byte-array-struct.svg?style=flat-square[\"Crates\", link=\"https://crates.io/crates/byte-array-struct\"]\nimage:https://img.shields.io/badge/License-Apache%202.0-blue.svg[\"License\"]\n\n\nProvides a macro to allows creation of a simple byte-array backed structs.\nSuch struct has a predefined size and allocated on the stack.\n\n== Usage\n\n=== Dependency\n\n----\n[dependencies]\nbyte-array-struct = \"0.2\"\n----\n\n=== Example\n\n[source, rust]\n----\n// create struct named Address backed by [u8; 24]`\nbyte_array_struct!(\n    pub struct Address(24);\n);\n\nimpl Address {\n    // any additional functionality for Address type\n}\n\n// passed as a value on stack\nfn send(to: Address) {\n   // ...\n}\n\nfn main() {\n  //accepts hex, which can also be prefixed with 0x\n  let foo = Address::from_str(\"0123456789abcdef0123456789abcdef0123456789abcdef\").unwrap();\n\n  send(foo);\n}\n----\n\n=== Provides\n\nMacro provides implementation for following traits:\n\n- `.deref()`\n- `.from_str(s)`, which accepts a hex string with the length of target array; may be optionally prefixed with `0x`\n- `.to_string()`\n- `.from([u8; ...])` and `.from(\u0026[u8; ...])`, where `...` is the defined size\n- `.try_from(Vec\u003cu8\u003e)` and `.try_from(\u0026[u8])`\n- `.into(Vec\u003cu8\u003e)` and `.into([u8; ...])`\n- `.serialize` and `.deserialize` for Serde, with `with-serde` feature enabled (not enabled by default)\n\n=== Features\n\n- `with-serde` to implement serialization/deserialization with Serde. Uses Hex encoded strings.\n\n== License\n\nCopyright 2020 EmeraldPay, Inc\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femeraldpay%2Fbyte-array-struct","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femeraldpay%2Fbyte-array-struct","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femeraldpay%2Fbyte-array-struct/lists"}