{"id":13469393,"url":"https://github.com/sharksforarms/deku","last_synced_at":"2025-05-13T17:13:24.396Z","repository":{"id":37482016,"uuid":"248276860","full_name":"sharksforarms/deku","owner":"sharksforarms","description":"Declarative binary reading and writing: bit-level, symmetric, serialization/deserialization","archived":false,"fork":false,"pushed_at":"2025-04-14T20:22:07.000Z","size":1074,"stargazers_count":1206,"open_issues_count":63,"forks_count":59,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-25T14:43:53.289Z","etag":null,"topics":["bits","bytes","declarative","deku","deserialization","encoder-decoder","parse","rust","rust-crate","serialization","symmetric"],"latest_commit_sha":null,"homepage":"","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/sharksforarms.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","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":["sharksforarms","wcampbell0x2a"]}},"created_at":"2020-03-18T15:55:42.000Z","updated_at":"2025-04-25T07:39:37.000Z","dependencies_parsed_at":"2023-10-04T10:29:03.258Z","dependency_job_id":"e0ce86c2-5676-486d-841f-f22d105f48e7","html_url":"https://github.com/sharksforarms/deku","commit_stats":{"total_commits":427,"total_committers":34,"mean_commits":"12.558823529411764","dds":0.5152224824355972,"last_synced_commit":"704f7c7198d2042b2a05badbe8792060d56c8f77"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharksforarms%2Fdeku","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharksforarms%2Fdeku/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharksforarms%2Fdeku/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharksforarms%2Fdeku/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sharksforarms","download_url":"https://codeload.github.com/sharksforarms/deku/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253990492,"owners_count":21995776,"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":["bits","bytes","declarative","deku","deserialization","encoder-decoder","parse","rust","rust-crate","serialization","symmetric"],"created_at":"2024-07-31T15:01:37.324Z","updated_at":"2025-05-13T17:13:19.378Z","avatar_url":"https://github.com/sharksforarms.png","language":"Rust","funding_links":["https://github.com/sponsors/sharksforarms","https://github.com/sponsors/wcampbell0x2a"],"categories":["Rust","Language specific libraries","rust"],"sub_categories":[],"readme":"# Deku\n\n[![Latest Version](https://img.shields.io/crates/v/deku.svg)](https://crates.io/crates/deku)\n[![Rust Documentation](https://docs.rs/deku/badge.svg)](https://docs.rs/deku)\n[![Actions Status](https://github.com/sharksforarms/deku/workflows/CI/badge.svg)](https://github.com/sharksforarms/deku/actions)\n[![codecov](https://codecov.io/gh/sharksforarms/deku/branch/master/graph/badge.svg)](https://codecov.io/gh/sharksforarms/deku)\n\nDeclarative binary reading and writing\n\nThis crate provides bit-level, symmetric, serialization/deserialization\nimplementations for structs and enums\n\n## Why use Deku\n\n**Productivity**: Deku will generate symmetric reader/writer functions for your type!\nAvoid the requirement of writing redundant, error-prone parsing and writing code\nfor binary structs or network headers\n\n## Usage\n*Compiler support: requires rustc 1.81+*\n\n```toml\n[dependencies]\ndeku = \"0.19\"\n```\n\nno_std:\n```toml\n[dependencies]\ndeku = { version = \"0.19\", default-features = false, features = [\"alloc\"] }\n```\n\n## Example\n\nSee [documentation](https://docs.rs/deku) or\n[examples](https://github.com/sharksforarms/deku/tree/master/examples) folder for more!\n\nRead big-endian data into a struct, modify a value, and write it\n\n```rust\nuse deku::prelude::*;\n\n#[derive(Debug, PartialEq, DekuRead, DekuWrite)]\n#[deku(endian = \"big\")]\nstruct DekuTest {\n    #[deku(bits = 4)]\n    field_a: u8,\n    #[deku(bits = 4)]\n    field_b: u8,\n    field_c: u16,\n}\n\nfn main() {\n    let data: Vec\u003cu8\u003e = vec![0b0110_1001, 0xBE, 0xEF];\n    let (_rest, mut val) = DekuTest::from_bytes((data.as_ref(), 0)).unwrap();\n    assert_eq!(DekuTest {\n        field_a: 0b0110,\n        field_b: 0b1001,\n        field_c: 0xBEEF,\n    }, val);\n\n    val.field_c = 0xC0FE;\n\n    let data_out = val.to_bytes().unwrap();\n    assert_eq!(vec![0b0110_1001, 0xC0, 0xFE], data_out);\n}\n```\n\n## Changelog\n\nSee [CHANGELOG.md](https://github.com/sharksforarms/deku/blob/master/CHANGELOG.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharksforarms%2Fdeku","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsharksforarms%2Fdeku","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharksforarms%2Fdeku/lists"}