{"id":20372178,"url":"https://github.com/ealmloff/const-serialize","last_synced_at":"2025-10-02T21:31:42.168Z","repository":{"id":261494958,"uuid":"884482174","full_name":"ealmloff/const-serialize","owner":"ealmloff","description":"Like serde::Serialize + serde::Deserialize but const","archived":false,"fork":false,"pushed_at":"2024-11-08T19:58:56.000Z","size":83,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-15T06:38:51.254Z","etag":null,"topics":["const","rust"],"latest_commit_sha":null,"homepage":"","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/ealmloff.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}},"created_at":"2024-11-06T20:42:18.000Z","updated_at":"2024-11-14T14:11:37.000Z","dependencies_parsed_at":"2024-11-06T21:41:39.539Z","dependency_job_id":"0891bc4f-3317-4849-ac04-3e3f9b461e93","html_url":"https://github.com/ealmloff/const-serialize","commit_stats":null,"previous_names":["ealmloff/const-serialize"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ealmloff%2Fconst-serialize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ealmloff%2Fconst-serialize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ealmloff%2Fconst-serialize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ealmloff%2Fconst-serialize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ealmloff","download_url":"https://codeload.github.com/ealmloff/const-serialize/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235043934,"owners_count":18927011,"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":["const","rust"],"created_at":"2024-11-15T01:12:00.482Z","updated_at":"2025-10-02T21:31:41.804Z","avatar_url":"https://github.com/ealmloff.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"A rust serialization library that works in const with complex(ish) types like enums, nested structs and arrays. Const rust does not have an allocator, so this library cannot work in a cross architecture environment with Vecs, slices or strings.\n\n```rust\n#[derive(Clone, Copy, Debug, PartialEq, SerializeConst)]\nstruct Struct {\n    a: u32,\n    b: u8,\n    c: u32,\n    d: Enum,\n}\n\n#[derive(Clone, Copy, Debug, PartialEq, SerializeConst)]\n#[repr(C, u8)]\nenum Enum {\n    A { one: u32, two: u16 },\n    B { one: u8, two: u16 } = 15,\n}\n\nconst {\n    let data = [Struct {\n        a: 0x11111111,\n        b: 0x22,\n        c: 0x33333333,\n        d: Enum::A {\n            one: 0x44444444,\n            two: 0x5555,\n        },\n    }; 3];\n    let mut buf = ConstWriteBuffer::new();\n    buf = serialize_const(\u0026data, buf);\n    let buf = buf.read();\n    let deserialized = match deserialize_const!([Struct; 3], buf) {\n        Some(data) =\u003e data,\n        None =\u003e panic!(\"data mismatch\"),\n    };\n    if !serialize_eq(\u0026data, \u0026deserialized) {\n        panic!(\"data mismatch\");\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fealmloff%2Fconst-serialize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fealmloff%2Fconst-serialize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fealmloff%2Fconst-serialize/lists"}