Docs.rs
  • json-api-0.4.0
    • json-api 0.4.0
    • Docs.rs crate page
    • MIT/Apache-2.0
    • Links
    • Repository
    • crates.io
    • Source
    • Owners
    • zacharygolba
    • Dependencies
      • error-chain ^0.11
      • http ^0.1
      • ordermap ^0.3
      • percent-encoding ^1.0
      • serde ^1.0
      • serde_derive ^1.0
      • serde_json ^1.0
      • serde_qs ^0.3
    • Versions
  • Go to latest version
  • Platform
    • i686-apple-darwin
    • i686-pc-windows-msvc
    • x86_64-apple-darwin
    • x86_64-pc-windows-msvc
    • x86_64-unknown-linux-gnu
  • Feature flags
  • docs.rs
    • About docs.rs
    • Privacy policy
  • Rust
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation

Crate json_api

  • Reexports
  • Modules
  • Macros
  • Structs
  • Enums
  • Traits
  • Functions

Crates

  • json_api

Crate json_api [−] [src]

[−] Expand description

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.

Results for Index

json_api::Resource::idReturns a given resource's id as a string. 
json_api::doc::ErrorObject::idA unique identifier for this particular occurrence of the problem. 
json_api::doc::Identifier::idA string that contains a unique identfier for this resource type (`kind`). For more information, check out the [identification] section of the JSON API specification. 
json_api::doc::NewObject::idAn optional string that contains a unique identfier for this resource type (`kind`). A `Some` value here should be interpreted as [client-generated id]. For more information, check out the [identification] section of the JSON API specification. 
json_api::doc::Object::idA string that contains a unique identfier for this resource type (`kind`). For more information, check out the [identification] section of the JSON API specification. 
json_api::doc::Relationship::ne 
json_api::doc::JsonApi::ne 
json_api::doc::ErrorObject::ne 
json_api::doc::ErrorSource::ne 
json_api::doc::Document::ne 
json_api::doc::Data::ne 
json_api::query::Page::ne 
json_api::query::Sort::ne 
json_api::query::Query::ne 
json_api::value::Value::ne 
json_api::value::Number::ne 
json_api::value::collections::map::Map::ne 
json_api::value::collections::set::Set::ne 
json_api::value::fields::Key::ne 
json_api::value::fields::Path::ne 
json_api::query::Sort::neg 
json_api::query::Direction::neg 
json_api::doc::Identifier::newReturns a new `Identifier`. 
json_api::doc::Object::newReturns a new `Object`. 
json_api::doc::NewObject::newReturns a new `NewObject`. 
json_api::doc::Relationship::newReturns a new `Relationship`. 
json_api::doc::JsonApi::newReturns a new `JsonApi` with the specified `version`. 
json_api::doc::ErrorObject::newReturns a new `ErrorObject` with the specified `status`. 
json_api::doc::ErrorSource::newReturns a new `ErrorSource` with the specified `parameter` and `pointer` values. 
json_api::query::Page::newReturns a new `Page`. If zero is used for `number` it will be treated as `1`. 
json_api::query::Sort::newReturns a new `Sort`. 
json_api::query::Query::newReturns the decoded equivalent of an empty query string. Does not require any allocations. 
json_api::value::collections::map::Map::newCreates an empty `Map`. 
json_api::value::collections::set::Set::newCreates an empty `Set`. 
json_api::value::fields::Path::newConstructs a new, empty `Path`. 
json_api::view::Context::newCreates a new, root context. 
json_api::error::Error::new 
json_api::doc::ErrorObject::codeAn application-specific error code, expressed as a string value. 
json_api::value::collections::map::IterAn iterator over the entries of a `Map`. 
json_api::value::collections::set::IterAn iterator over the items of a `Set`. 
json_api::error::Error::iterIterates over the error chain. 
json_api::value::collections::map::Map::iterReturn an iterator visiting all the key-value pairs of the map in the order in which they were inserted. 
json_api::value::collections::set::Set::iterReturn an iterator visiting all the elements of the set in the order in which they were inserted. 
json_api::error::Error::iter 
json_api::Resource::kindReturns a key containing the type of resource. 
json_api::error::Error::kindReturns the kind of the error. 
json_api::doc::Identifier::kindDescribes resources that share common attributes and relationships. This field is derived from the `type` field if the identifier is deserialized. For more information, check out the [identification] section of the JSON API specification. 
json_api::doc::NewObject::kindDescribes resources that share common attributes and relationships. This field is derived from the `type` field if the object is deserialized. For more information, check out the [identification] section of the JSON API specification. 
json_api::doc::Object::kindDescribes resources that share common attributes and relationships. This field is derived from the `type` field if the object is deserialized. For more information, check out the [identification] section of the JSON API specification. 
json_api::error::Error::kind 
json_api::value::collections::map::Drain::next 
json_api::value::collections::map::Iter::next 
json_api::value::collections::map::IterMut::next 
json_api::value::collections::map::IntoIter::next 
json_api::value::collections::map::Keys::next 
json_api::value::collections::map::Values::next 
json_api::value::collections::map::ValuesMut::next 
json_api::value::collections::set::Drain::next 
json_api::value::collections::set::Iter::next 
json_api::value::collections::set::IntoIter::next 
json_api::value::collections::map::Map::insertInserts a key-value pair into the map. 
json_api::value::collections::set::Set::insertAdds a value to the set. 
json_api::view::RenderA trait to render a given type as a document. 
json_api::view::Render::renderAttempts to render the given type as a document. 
json_api::doc::Identifier::render 
json_api::doc::Object::render 
json_api::doc::NewObject::render 
json_api::doc::Document::render 

Help

Keyboard Shortcuts

?
Show this help dialog
S
Focus the search field
⇤
Move up in search results
⇥
Move down in search results
⏎
Go to active search result
+
Collapse/expand all sections

Search Tricks

Prefix searches with a type followed by a colon (e.g. fn:) to restrict the search to a given type.

Accepted types are: fn, mod, struct, enum, trait, type, macro, and const.

Search functions by type signature (e.g. vec -> usize or * -> vec)