Module rocket::serde::json[][src]

This is supported on crate feature json only.
Expand description

Automatic JSON (de)serialization support.

See Json for details.

Enabling

This module is only available when the json feature is enabled. Enable it in Cargo.toml as follows:

[dependencies.rocket]
version = "0.5.0-rc.1"
features = ["json"]

Testing

The LocalRequest and LocalResponse types provide json() and into_json() methods to create a request with serialized JSON and deserialize a response as JSON, respectively.

Macros

json

A macro to create ad-hoc JSON serializable values using JSON syntax.

Structs

Json

The JSON guard: easily consume and return JSON.

Enums

Error

Error returned by the Json guard when JSON deserialization fails.

Value

An arbitrary JSON value as returned by json!.

Functions

from_slice

Deserialize an instance of type T from bytes of JSON text.

from_str

Deserialize an instance of type T from a string of JSON text.

from_value

Interpret a Value as an instance of type T.