mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-20 20:51:04 +00:00
Fix references to serde::json
This commit is contained in:
@@ -39,7 +39,7 @@ struct Point {
|
|||||||
```
|
```
|
||||||
|
|
||||||
Serde bundles a high performance JSON serializer and deserializer,
|
Serde bundles a high performance JSON serializer and deserializer,
|
||||||
[serde::json](http://serde-rs.github.io/serde/serde/json/index.html),
|
[serde_json](http://serde-rs.github.io/serde/serde_json/index.html),
|
||||||
which comes with the helper functions
|
which comes with the helper functions
|
||||||
[to_string](http://serde-rs.github.io/serde/serde/json/ser/fn.to_string.html)
|
[to_string](http://serde-rs.github.io/serde/serde/json/ser/fn.to_string.html)
|
||||||
and
|
and
|
||||||
@@ -47,7 +47,7 @@ and
|
|||||||
that make it easy to go to and from JSON:
|
that make it easy to go to and from JSON:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
use serde::json;
|
use serde_json;
|
||||||
|
|
||||||
...
|
...
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ println!("{}", serialized_point); // prints: {"x":1,"y":2}
|
|||||||
let deserialize_point: Point = json::from_str(&serialized_point).unwrap();
|
let deserialize_point: Point = json::from_str(&serialized_point).unwrap();
|
||||||
```
|
```
|
||||||
|
|
||||||
[serde::json](http://serde-rs.github.io/serde/serde/json/index.html) also
|
[serde_json](http://serde-rs.github.io/serde/serde_json/index.html) also
|
||||||
supports a generic
|
supports a generic
|
||||||
[Value](http://serde-rs.github.io/serde/serde/json/value/enum.Value.html)
|
[Value](http://serde-rs.github.io/serde/serde/json/value/enum.Value.html)
|
||||||
type, which can represent any JSON value. Also, any
|
type, which can represent any JSON value. Also, any
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
//! encode structured data in a text format that can be easily read by humans. Its simple syntax
|
//! encode structured data in a text format that can be easily read by humans. Its simple syntax
|
||||||
//! and native compatibility with JavaScript have made it a widely used format.
|
//! and native compatibility with JavaScript have made it a widely used format.
|
||||||
//!
|
//!
|
||||||
//! Data types that can be encoded are JavaScript types (see the `serde::json:Value` enum for more
|
//! Data types that can be encoded are JavaScript types (see the `serde_json:Value` enum for more
|
||||||
//! details):
|
//! details):
|
||||||
//!
|
//!
|
||||||
//! * `Boolean`: equivalent to rust's `bool`
|
//! * `Boolean`: equivalent to rust's `bool`
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
//! * `String`: equivalent to rust's `String`
|
//! * `String`: equivalent to rust's `String`
|
||||||
//! * `Array`: equivalent to rust's `Vec<T>`, but also allowing objects of different types in the
|
//! * `Array`: equivalent to rust's `Vec<T>`, but also allowing objects of different types in the
|
||||||
//! same array
|
//! same array
|
||||||
//! * `Object`: equivalent to rust's `BTreeMap<String, serde::json::Value>`
|
//! * `Object`: equivalent to rust's `BTreeMap<String, serde_json::Value>`
|
||||||
//! * `Null`
|
//! * `Null`
|
||||||
//!
|
//!
|
||||||
//! An object is a series of string keys mapping to values, in `"key": value` format. Arrays are
|
//! An object is a series of string keys mapping to values, in `"key": value` format. Arrays are
|
||||||
@@ -48,8 +48,8 @@
|
|||||||
//! `serde::Deserialize` trait. Serde provides provides an annotation to automatically generate
|
//! `serde::Deserialize` trait. Serde provides provides an annotation to automatically generate
|
||||||
//! the code for these traits: `#[derive(Serialize, Deserialize)]`.
|
//! the code for these traits: `#[derive(Serialize, Deserialize)]`.
|
||||||
//!
|
//!
|
||||||
//! The JSON API also provides an enum `serde::json::Value` and a method `to_value` to serialize
|
//! The JSON API also provides an enum `serde_json::Value` and a method `to_value` to serialize
|
||||||
//! objects. A `serde::json::Value` value can be serialized as a string or buffer using the
|
//! objects. A `serde_json::Value` value can be serialized as a string or buffer using the
|
||||||
//! functions described above. You can also use the `json::Serializer` object, which implements the
|
//! functions described above. You can also use the `json::Serializer` object, which implements the
|
||||||
//! `Serializer` trait.
|
//! `Serializer` trait.
|
||||||
//!
|
//!
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
//!
|
//!
|
||||||
//! extern crate serde;
|
//! extern crate serde;
|
||||||
//!
|
//!
|
||||||
//! use serde::json::{self, Value};
|
//! use serde_json::{self, Value};
|
||||||
//!
|
//!
|
||||||
//! fn main() {
|
//! fn main() {
|
||||||
//! let data: Value = json::from_str("{\"foo\": 13, \"bar\": \"baz\"}").unwrap();
|
//! let data: Value = json::from_str("{\"foo\": 13, \"bar\": \"baz\"}").unwrap();
|
||||||
|
|||||||
Reference in New Issue
Block a user