Crate json_api [] [src]

Idiomatic types for building a robust JSON API.

Reexports

pub extern crate http;

Modules

doc

Components of a JSON API document.

error

The Error struct, the Result alias, and other tools to handle failure.

query

An API for working with well-known query parameters.

value

Represent and interact with JSON API values.

view

Low-level utilies for generically rendering a document.

Macros

resource

A DSL for implementing the Resource trait.

Structs

Error

The Error type.

Enums

Document

Represents a compound JSON API document.

Value

Represents any valid JSON API value.

Traits

Resource

A trait indicating that the given type can be represented as a resource.

Functions

from_doc

Interpret a Document<T> as a type U.

from_reader

Deserialize a Document<T> from an IO stream of JSON text and then iterpret it as a type U.

from_slice

Deserialize a Document<T> from bytes of JSON text and then iterpret it as a type U.

from_str

Deserialize a Document<T> from a string of JSON text and then iterpret it as a type U.

from_value

Interpret a Value as a type T.

to_doc

Render type T as a Document<U>.

to_string

Render type T as a Document<U> and then serialize it as a string of JSON.

to_string_pretty

Render type T as a Document<U> and then serialize it as a pretty-printed string of JSON.

to_value

Convert a T into a Value.

to_vec

Render type T as a Document<U> and then serialize it as a JSON byte vector.

to_vec_pretty

Render type T as a Document<U> and then serialize it as a pretty-printed JSON byte vector.

to_writer

Render type T as a Document<U> and then serialize it as JSON into the IO stream.

to_writer_pretty

Render type T as a Document<U> and then serialize it as pretty-printed JSON into the IO stream.