{"id":21272732,"url":"https://github.com/trussed-dev/serde-indexed","last_synced_at":"2025-12-12T14:48:19.150Z","repository":{"id":57666714,"uuid":"233244790","full_name":"trussed-dev/serde-indexed","owner":"trussed-dev","description":"Derivation of Serialize and Deserialize that replaces struct keys with numerical indices.","archived":false,"fork":false,"pushed_at":"2025-06-06T08:42:15.000Z","size":49,"stargazers_count":3,"open_issues_count":4,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-06T10:42:52.322Z","etag":null,"topics":["cbor","no-std","rust","serde"],"latest_commit_sha":null,"homepage":"https://docs.rs/serde-indexed/","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/trussed-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2020-01-11T14:31:16.000Z","updated_at":"2025-06-06T08:40:40.000Z","dependencies_parsed_at":"2023-12-29T22:17:10.158Z","dependency_job_id":"64ef3174-f563-4326-bfbf-7a884ed45fa8","html_url":"https://github.com/trussed-dev/serde-indexed","commit_stats":null,"previous_names":["nickray/serde-indexed","trussed-dev/serde-indexed","ycrypto/serde-indexed"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/trussed-dev/serde-indexed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trussed-dev%2Fserde-indexed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trussed-dev%2Fserde-indexed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trussed-dev%2Fserde-indexed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trussed-dev%2Fserde-indexed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trussed-dev","download_url":"https://codeload.github.com/trussed-dev/serde-indexed/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trussed-dev%2Fserde-indexed/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264747906,"owners_count":23657926,"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":["cbor","no-std","rust","serde"],"created_at":"2024-11-21T09:08:53.867Z","updated_at":"2025-12-12T14:48:14.097Z","avatar_url":"https://github.com/trussed-dev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## serde-indexed\n\n[![crates.io][crates-image]][crates-link]\n[![Documentation][docs-image]][docs-link]\n\nDerivation of [`Serialize`][serialize] and [`Deserialize`][deserialize] that replaces struct keys with numerical indices.\n\nPrimary use case is to handle [CTAP CBOR][ctap-cbor] messages, in particular support for:\n- [`skip_serializing_if`][skip-serializing-if] for optional keys\n- configurable index `offset`\n\n#### Example\n\n```rust\n#[derive(Clone, Debug, PartialEq, SerializeIndexed, DeserializeIndexed)]\n#[serde_indexed(offset = 1)]\npub struct SomeKeys {\n    pub number: i32,\n    #[serde(skip_serializing_if = \"Option::is_none\")]\n    pub option: Option\u003cu8\u003e,\n    pub bytes: [u8; 7],\n}\n```\n\nThis was a nice opportunity to learn proc-macros, I roughly followed [`serde-repr`][serde-repr].\n\nTo see some generated code, run `cargo expand --test basics`.\n\n[crates-image]: https://img.shields.io/crates/v/serde-indexed.svg?style=flat-square\n[crates-link]: https://crates.io/crates/serde-indexed\n[docs-image]: https://img.shields.io/badge/docs.rs-api-green?style=flat-square\n[docs-link]: https://docs.rs/serde-indexed\n[serialize]: https://docs.serde.rs/serde/ser/trait.Serialize.html\n[deserialize]: https://docs.serde.rs/serde/de/trait.Deserialize.html\n[ctap-cbor]: https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#ctap2-canonical-cbor-encoding-form\n[skip-serializing-if]: https://serde.rs/field-attrs.html#skip_serializing_if\n[serde-repr]: https://github.com/dtolnay/serde-repr\n\n#### License\n\n\u003csup\u003e`serde-indexed` is licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or [MIT License](LICENSE-MIT) at your option.\u003c/sup\u003e\n\u003cbr\u003e\n\u003csub\u003eUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\u003c/sub\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrussed-dev%2Fserde-indexed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrussed-dev%2Fserde-indexed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrussed-dev%2Fserde-indexed/lists"}