{"id":13822321,"url":"https://github.com/mitsuhiko/deser","last_synced_at":"2025-07-12T16:07:02.613Z","repository":{"id":43736609,"uuid":"455334691","full_name":"mitsuhiko/deser","owner":"mitsuhiko","description":"Experimental rust serialization library","archived":false,"fork":false,"pushed_at":"2023-08-20T21:36:47.000Z","size":3235,"stargazers_count":294,"open_issues_count":14,"forks_count":7,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-06-24T10:50:07.758Z","etag":null,"topics":["rust","serialization"],"latest_commit_sha":null,"homepage":"https://docs.rs/deser","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/mitsuhiko.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":["mitsuhiko"]}},"created_at":"2022-02-03T21:29:00.000Z","updated_at":"2025-06-19T10:32:43.000Z","dependencies_parsed_at":"2024-01-18T03:48:54.626Z","dependency_job_id":null,"html_url":"https://github.com/mitsuhiko/deser","commit_stats":{"total_commits":93,"total_committers":1,"mean_commits":93.0,"dds":0.0,"last_synced_commit":"1ec208adb84e60f60b8f4c00d2f53a786f37a8e7"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/mitsuhiko/deser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitsuhiko%2Fdeser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitsuhiko%2Fdeser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitsuhiko%2Fdeser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitsuhiko%2Fdeser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitsuhiko","download_url":"https://codeload.github.com/mitsuhiko/deser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitsuhiko%2Fdeser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265017216,"owners_count":23698444,"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","serialization"],"created_at":"2024-08-04T08:01:54.585Z","updated_at":"2025-07-12T16:07:02.579Z","avatar_url":"https://github.com/mitsuhiko.png","language":"Rust","funding_links":["https://github.com/sponsors/mitsuhiko"],"categories":["Rust"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n \u003cimg src=\"https://raw.githubusercontent.com/mitsuhiko/deser/main/artwork/logo.svg\" width=\"250\" height=\"250\"\u003e\n \u003cp\u003e\u003cstrong\u003edeser: an experimental serialization and deserialization library for Rust\u003c/strong\u003e\u003c/p\u003e\n\u003c/div\u003e\n\n[![Crates.io](https://img.shields.io/crates/d/deser.svg)](https://crates.io/crates/deser)\n[![License](https://img.shields.io/github/license/mitsuhiko/deser)](https://github.com/mitsuhiko/deser/blob/main/LICENSE)\n[![Documentation](https://docs.rs/deser/badge.svg)](https://docs.rs/deser)\n\nDeser is an experimental serialization system for Rust.  It wants to explore the\npossibilities of serialization and deserialization of structural formats such as\nJSON or msgpack.  It intentionally does not desire to support non self\ndescribing formats such as bincode.\n\n**This is not a production ready yet.**\n\n```rust\nuse deser::{Serialize, Deserialize};\n\n#[derive(Debug, Serialize, Deserialize)]\n#[deser(rename_all = \"camelCase\")]\npub struct Account {\n    id: usize,\n    account_holder: String,\n    is_deactivated: bool,\n}\n```\n\nThis generates out the necessary\n[`Serialize`](https://docs.rs/deser/latest/deser/ser/trait.Serialize.html) and\n[`Deserialize`](https://docs.rs/deser/latest/deser/de/trait.Deserialize.html)\nimplementations.\n\nTo see some practical examples of this have a look at the\n[examples](https://github.com/mitsuhiko/deser/tree/main/examples).\n\n## Design Goals\n\n* **Fast Compile Times:** deser avoids excessive monomorphization by encouraging\n  dynamic dispatch.  The goal is to avoid generating a lot of duplicate code that\n  produces bloat the compiler needs to churn through.\n* **Simple Data Model:** deser simplifies the data model on the serialization\n  and deserialization interface.  For instance instead of making a distinction\n  between `u8` and `u64` they are represented the same in the model.  To compensate\n  for this, it provides type descriptors that provide auxiliary information for\n  when a serializer wants to process it.  This helps with compile times and makes\n  using the crate easier.\n* **Native Bytes Support:** deser has built-in specialization for serializing\n  bytes and byte vectors.  A `Vec\u003cu8\u003e` is serialized as bytes and does not need\n  special handling for text-only formats such as JSON.\n* **Unlimited Recursion:** the real world is nasty and incoming data might be\n  badly nested.  Deser does not exhaust the call stack no matter how deep your\n  data is.  It accomplishes this by an alternative trait design to serde where\n  handles to \"sinks\" or \"serializable\" objects are returned.  This means that\n  it's up to the caller to manage the recursion.\n* **Native Optionals:** the serialization system has a built-in understanding of\n  the concept of optional data.  This means that with a single attribute a struct\n  serializer can skip over all fields currently set to null.\n* **Native Flattening Support:** deser's serialization and deserialization support\n  has native support for flattening of structs.  This means no internal buffering\n  is required for `#[deser(flatten)]`.\n* **Stateful Processing:** deser compensates the simplified data model with providing\n  a space to hold meta information.  Out of the box it provides information\n  about the types that are being serialized.  The additional space can be used\n  to keep track of the \"path\" to the current structure during serialization and\n  deserialization.  (See [deser-path](https://docs.rs/deser-path/) for a\n  practical example)\n\nDeser does not intend on replacing serde but it attempts to address some if it's\nshortcomings.  For more information there is a document about [Serde\nLearnings](https://github.com/mitsuhiko/deser/blob/main/SERDE.md) with\nmore details.\n\n## Future Plans\n\n* **Extensible Data Model:** deser wants to make it possible to extend the data\n  model with types that are not native to the serialization interface.  For\n  instance if a data format wants to support arbitrarily sized integers this\n  should be possible without falling back to in-band\n  signalling.\n\n## Known Limitations\n\nThe current design of this system is very allocation heavy.  This is the consequence\nof a certain level of flexibility paired with the dynamic dispatch nature.  For instance\nfor JSON parsing, Serde is more than 3 times faster than Deser and for deserialization\n2.5 times.\n\n## Crates\n\n* [deser](https://github.com/mitsuhiko/deser/tree/main/deser): the core crate\n  providing the base functionality\n* [deser-json](https://github.com/mitsuhiko/deser/tree/main/deser-json): basic\n  JSON implementation for deser\n* [deser-path](https://github.com/mitsuhiko/deser/tree/main/deser-path): a crate\n  that extends deser to track the path during serialization\n* [deser-debug](https://github.com/mitsuhiko/deser/tree/main/deser-debug): formats\n  a serializable to the `std::fmt` debug format\n\n## Inspiration\n\nThis crate heavily borrows from\n[`miniserde`](https://github.com/dtolnay/miniserde),\n[`serde`](https://serde.rs/) and [Sentry Relay's meta\nsystem](https://github.com/getsentry/relay).  The general trait design was\nmodelled after `miniserde`.\n\n## Safety\n\nDeser (currently) uses excessive amounts of unsafe code internally.  It is not vetted and\nit is likely completely wrong.  If this design turns out to be useful there will be need\nto be a re-design of the internals.\n\n## License and Links\n\n- [Issue Tracker](https://github.com/mitsuhiko/deser/issues)\n- [Documentation](https://docs.rs/deser)\n- License: [Apache-2.0](https://github.com/mitsuhiko/deser/blob/master/LICENSE)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitsuhiko%2Fdeser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitsuhiko%2Fdeser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitsuhiko%2Fdeser/lists"}