{"id":17441505,"url":"https://github.com/traviskaufman/serde_bencode","last_synced_at":"2025-03-23T17:14:41.958Z","repository":{"id":142121522,"uuid":"69839112","full_name":"traviskaufman/serde_bencode","owner":"traviskaufman","description":"Bencode serialization / deserialization for rust, powered by serde","archived":false,"fork":false,"pushed_at":"2016-10-17T01:02:29.000Z","size":22,"stargazers_count":2,"open_issues_count":6,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-28T23:11:32.142Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/traviskaufman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-03T03:47:34.000Z","updated_at":"2023-09-22T09:05:29.000Z","dependencies_parsed_at":"2023-07-18T18:25:06.934Z","dependency_job_id":null,"html_url":"https://github.com/traviskaufman/serde_bencode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traviskaufman%2Fserde_bencode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traviskaufman%2Fserde_bencode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traviskaufman%2Fserde_bencode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traviskaufman%2Fserde_bencode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/traviskaufman","download_url":"https://codeload.github.com/traviskaufman/serde_bencode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245136396,"owners_count":20566588,"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":[],"created_at":"2024-10-17T15:28:19.056Z","updated_at":"2025-03-23T17:14:41.931Z","avatar_url":"https://github.com/traviskaufman.png","language":"Rust","readme":"# Bencode\n\n[![Build Status](https://travis-ci.org/traviskaufman/serde_bencode.svg?branch=master)](https://travis-ci.org/traviskaufman/serde_bencode)\n\nA [bencode](https://en.wikipedia.org/wiki/Bencode) serialization/deserialization library for Rust using\n[serde](https://serde.rs/).\n\n\u003e Status: Work in Progress. Check out the [1.0.0 Milestone](https://github.com/traviskaufman/bencode-rs/milestone/1)!\n\n## Usage\n\n```rust\nextern crate serde;\nextern crate serde_bencode;\n\n#[derive(Serialize, Deserialize, Debug)]\nstruct Point {\n    x: i32,\n    y: i32\n}\n\n#[derive(Serialize, Deserialize, Debug)]\nstruct Complex {\n    s: String,\n    i: i32,\n    v: Vec\u003cPoint\u003e\n}\n\n// main.rs\nfn main() {\n    let c = Complex {\n        s: \"Hello, World!\".to_string(),\n        i: 42,\n        v: vec![Point{ x: 1, y: 2}, Point{ x: 4, y: 7}, Point{ x: 8, y: 19 }]\n    };\n    println!(\"original = {:?}\", c);\n    let serialized = serde_bencode::to_string(\u0026c).unwrap();\n    println!(\"serialized = {}\", serialized);\n    let deserialized: Complex = serde_bencode::from_string(serialized).unwrap();\n    println!(\"deserialized = {:?}\", deserialized);\n}\n```\n\nPrints:\n\n```\noriginal = Complex { s: \"Hello, World!\", i: 42, v: [Point { x: 1, y: 2 }, Point { x: 4, y: 7 }, Point { x: 8, y: 19 }] }\nserialized = d1:ii42e1:s13:Hello, World!1:vld1:xi1e1:yi2eed1:xi4e1:yi7eed1:xi8e1:yi19eeee\ndeserialized = Complex { s: \"Hello, World!\", i: 42, v: [Point { x: 1, y: 2 }, Point { x: 4, y: 7 }, Point { x: 8, y: 19 }] }\n```\n\nCargo installation, API docs, and actual usage coming soon!\n\nThis implementation borrows very heavily from [serde_json](https://github.com/serde-rs/json), which was used as a\nmodel for how to build this serializer. Some ideas, like `Read`, were lifted directly from that code.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraviskaufman%2Fserde_bencode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftraviskaufman%2Fserde_bencode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraviskaufman%2Fserde_bencode/lists"}