Skip to content
Myr

README.md

This file

Path

README.md

114 lines · 4.3 KiB · Markdown

Last changed by

Raise required compiler for serde_derive to Rust 1.71David Tolnaybefore adoption681270e

History of this file

Take it

The walk stopped after 200 commits: lines older than 3761854 point at it.

Raise required compiler for serde_derive to Rust 1.71David Tolnaybefore adoption681270e

line 1why, one step back
1# Serde   [![Build Status]][actions] [![Latest Version]][crates.io] [![serde msrv]][Rust 1.56] [![serde_derive msrv]][Rust 1.71]

Merge pull request #2745 from dtolnay/docsrsDavid Tolnaybefore adoption3761854

lines 2–8why, one step back
2
3[Build Status]: https://img.shields.io/github/actions/workflow/status/serde-rs/serde/ci.yml?branch=master4[actions]: https://github.com/serde-rs/serde/actions?query=branch%3Amaster5[Latest Version]: https://img.shields.io/crates/v/serde.svg6[crates.io]: https://crates.io/crates/serde7[serde msrv]: https://img.shields.io/crates/msrv/serde.svg?label=serde%20msrv&color=lightgray8[serde_derive msrv]: https://img.shields.io/crates/msrv/serde_derive.svg?label=serde_derive%20msrv&color=lightgray

Raise required compiler for serde_derive to Rust 1.65David Tolnaybefore adoptiond656b4d

line 9why, one step back
9[Rust 1.56]: https://blog.rust-lang.org/2021/10/21/Rust-1.56.0/

Raise required compiler for serde_derive to Rust 1.71David Tolnaybefore adoption681270e

line 10why, one step back
10[Rust 1.71]: https://blog.rust-lang.org/2023/07/13/Rust-1.71.0/

Merge pull request #2745 from dtolnay/docsrsDavid Tolnaybefore adoption3761854

lines 11–17why, one step back
11
12**Serde is a framework for *ser*ializing and *de*serializing Rust data structures efficiently and generically.**1314---1516You may be looking for:17

Link to serde.rs without trailing slashDavid Tolnaybefore adoption263a1db

line 18why, one step back
18- [An overview of Serde](https://serde.rs)

Merge pull request #2745 from dtolnay/docsrsDavid Tolnaybefore adoption3761854

lines 19–29why, one step back
19- [Data formats supported by Serde](https://serde.rs/#data-formats)
20- [Setting up `#[derive(Serialize, Deserialize)]`](https://serde.rs/derive.html)21- [Examples](https://serde.rs/examples.html)22- [API documentation](https://docs.rs/serde)23- [Release notes](https://github.com/serde-rs/serde/releases)2425## Serde in action2627<details>28<summary>29Click to show Cargo.toml.

Merge pull request #2919 from vishal-kr-barnwal/masterOli Schererbefore adoptionb9de365

line 30why, one step back
30<a href="https://play.rust-lang.org/?edition=2021&gist=72755f28f99afc95e01d63174b28c1f5" target="_blank">Run this code in the playground.</a>

Merge pull request #2745 from dtolnay/docsrsDavid Tolnaybefore adoption3761854

lines 31–114why, one step back
31</summary>
3233```toml34[dependencies]3536# The core APIs, including the Serialize and Deserialize traits. Always37# required when using Serde. The "derive" feature is only required when38# using #[derive(Serialize, Deserialize)] to make Serde work with structs39# and enums defined in your crate.40serde = { version = "1.0", features = ["derive"] }4142# Each data format lives in its own crate; the sample code below uses JSON43# but you may be using a different one.44serde_json = "1.0"45```4647</details>48<p></p>4950```rust51use serde::{Deserialize, Serialize};5253#[derive(Serialize, Deserialize, Debug)]54struct Point {55 x: i32,56 y: i32,57}5859fn main() {60 let point = Point { x: 1, y: 2 };6162 // Convert the Point to a JSON string.63 let serialized = serde_json::to_string(&point).unwrap();6465 // Prints serialized = {"x":1,"y":2}66 println!("serialized = {}", serialized);6768 // Convert the JSON string back to a Point.69 let deserialized: Point = serde_json::from_str(&serialized).unwrap();7071 // Prints deserialized = Point { x: 1, y: 2 }72 println!("deserialized = {:?}", deserialized);73}74```7576## Getting help7778Serde is one of the most widely used Rust libraries so any place that Rustaceans79congregate will be able to help you out. For chat, consider trying the80[#rust-questions] or [#rust-beginners] channels of the unofficial community81Discord (invite: <https://discord.gg/rust-lang-community>), the [#rust-usage] or82[#beginners] channels of the official Rust Project Discord (invite:83<https://discord.gg/rust-lang>), or the [#general][zulip] stream in Zulip. For84asynchronous, consider the [\[rust\] tag on StackOverflow][stackoverflow], the85[/r/rust] subreddit which has a pinned weekly easy questions post, or the Rust86[Discourse forum][discourse]. It's acceptable to file a support issue in this87repo but they tend not to get as many eyes as any of the above and may get88closed without a response after some time.8990[#rust-questions]: https://discord.com/channels/273534239310479360/27421513641440051391[#rust-beginners]: https://discord.com/channels/273534239310479360/27354152281571328192[#rust-usage]: https://discord.com/channels/442252698964721669/44315087811169484893[#beginners]: https://discord.com/channels/442252698964721669/44823800973374261294[zulip]: https://rust-lang.zulipchat.com/#narrow/stream/122651-general95[stackoverflow]: https://stackoverflow.com/questions/tagged/rust96[/r/rust]: https://www.reddit.com/r/rust97[discourse]: https://users.rust-lang.org9899<br>100101#### License102103<sup>104Licensed under either of <a href="LICENSE-APACHE">Apache License, Version1052.0</a> or <a href="LICENSE-MIT">MIT license</a> at your option.106</sup>107108<br>109110<sub>111Unless you explicitly state otherwise, any contribution intentionally submitted112for inclusion in Serde by you, as defined in the Apache-2.0 license, shall be113dual licensed as above, without any additional terms or conditions.114</sub>