{"id":13816508,"url":"https://github.com/pyfisch/cbor","last_synced_at":"2025-05-15T15:32:38.289Z","repository":{"id":48898881,"uuid":"42398450","full_name":"pyfisch/cbor","owner":"pyfisch","description":"CBOR support for serde.","archived":true,"fork":false,"pushed_at":"2022-05-22T04:17:41.000Z","size":351,"stargazers_count":306,"open_issues_count":49,"forks_count":100,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-05-14T05:22:25.988Z","etag":null,"topics":["cbor","parsing","serde"],"latest_commit_sha":null,"homepage":"https://docs.rs/serde_cbor/","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/pyfisch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-13T14:16:29.000Z","updated_at":"2025-05-08T09:56:12.000Z","dependencies_parsed_at":"2022-09-12T15:12:58.465Z","dependency_job_id":null,"html_url":"https://github.com/pyfisch/cbor","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyfisch%2Fcbor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyfisch%2Fcbor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyfisch%2Fcbor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyfisch%2Fcbor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyfisch","download_url":"https://codeload.github.com/pyfisch/cbor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254367685,"owners_count":22059555,"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","parsing","serde"],"created_at":"2024-08-04T05:00:43.989Z","updated_at":"2025-05-15T15:32:37.838Z","avatar_url":"https://github.com/pyfisch.png","language":"Rust","readme":"# Serde CBOR\n[![Build Status](https://travis-ci.org/pyfisch/cbor.svg?branch=master)](https://travis-ci.org/pyfisch/cbor)\n[![Crates.io](https://img.shields.io/crates/v/serde_cbor.svg)](https://crates.io/crates/serde_cbor)\n[![Documentation](https://docs.rs/serde_cbor/badge.svg)](https://docs.rs/serde_cbor)\n\n## PROJECT IS ARCHIVED\n\nAfter almost 6 years it is time to retire this crate.\nThis implementation of CBOR for serde is used in hundreds of projects with widely differing needs.\nBesides the standard features it contains code for no-std environments, a packed encoding and CBOR tags.\nHowever while these features are useful to many people they sometimes interact poorly with each others and with optional features of serde itself.\nBecause I don't use the crate myself and because of the potential for new errors I have been reluctant to accept any changes or additional features for the crate.\nSince this situation is unlikely to change anytime soon and no one else stepped up to maintain this crate I am archiving the repository today.\nIf the crate works for you there is no need to switch to another implementation.\nHowever if you encounter problems or for new projects I recommend you take a look at these crates:\n\n* [ciborium](https://crates.io/crates/ciborium)\n* [minicbor](https://crates.io/crates/minicbor)\n\n~~ Pyfisch, August 2021\n\n\n\nThis crate implements the Concise Binary Object Representation from [RFC 7049].\nIt builds on [Serde], the generic serialization framework for Rust.\nCBOR provides a binary encoding for a superset\nof the JSON data model that is small and very fast to parse.\n\n[RFC 7049]: https://tools.ietf.org/html/rfc7049\n[Serde]: https://github.com/serde-rs/serde\n\n## Usage\n\nSerde CBOR supports Rust 1.40 and up. Add this to your `Cargo.toml`:\n```toml\n[dependencies]\nserde_cbor = \"0.11.2\"\n```\n\nStoring and loading Rust types is easy and requires only\nminimal modifications to the program code.\n\n```rust\nuse serde_derive::{Deserialize, Serialize};\nuse std::error::Error;\nuse std::fs::File;\n\n// Types annotated with `Serialize` can be stored as CBOR.\n// To be able to load them again add `Deserialize`.\n#[derive(Debug, Serialize, Deserialize)]\nstruct Mascot {\n    name: String,\n    species: String,\n    year_of_birth: u32,\n}\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn Error\u003e\u003e {\n    let ferris = Mascot {\n        name: \"Ferris\".to_owned(),\n        species: \"crab\".to_owned(),\n        year_of_birth: 2015,\n    };\n\n    let ferris_file = File::create(\"examples/ferris.cbor\")?;\n    // Write Ferris to the given file.\n    // Instead of a file you can use any type that implements `io::Write`\n    // like a HTTP body, database connection etc.\n    serde_cbor::to_writer(ferris_file, \u0026ferris)?;\n\n    let tux_file = File::open(\"examples/tux.cbor\")?;\n    // Load Tux from a file.\n    // Serde CBOR performs roundtrip serialization meaning that\n    // the data will not change in any way.\n    let tux: Mascot = serde_cbor::from_reader(tux_file)?;\n\n    println!(\"{:?}\", tux);\n    // prints: Mascot { name: \"Tux\", species: \"penguin\", year_of_birth: 1996 }\n\n    Ok(())\n}\n```\n\nThere are a lot of options available to customize the format.\nTo operate on untyped CBOR values have a look at the `Value` type.\n\n## License\nLicensed under either of\n\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any\nadditional terms or conditions.\n","funding_links":[],"categories":["Rust","Libraries"],"sub_categories":["Encoding"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyfisch%2Fcbor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyfisch%2Fcbor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyfisch%2Fcbor/lists"}