Enum json_api::Document [] [src]

pub enum Document<T: PrimaryData> {
    Ok {
        data: Data<T>,
        included: Set<Object>,
        jsonapi: JsonApi,
        links: Map<Key, Link>,
        meta: Map,
    },
    Err {
        errors: Vec<ErrorObject>,
        jsonapi: JsonApi,
        links: Map<Key, Link>,
        meta: Map,
    },
}

Represents a compound JSON API document.

For more information, check out the document structure section of the JSON API specification.

Variants

Does not contain errors.

Fields of Ok

The primary data of the document. For more information, check out the top level section of the JSON API specification.

Included resources, resolved from the include query parameter of a client request.

Information about this implementation of the specification that the document was created with. For more information, check out the JSON API object section of the JSON API specification.

Contains relevant links. If this value of this field is empty, it will not be serialized. For more information, check out the links section of the JSON API specification.

Non-standard meta information. If this value of this field is empty, it will not be serialized. For more information, check out the meta information section of the JSON API specification.

Contains 1 or more error(s).

Fields of Err

Methods

impl<T: PrimaryData> Document<T>
[src]

[src]

Returns true if the document does not contain any errors.

[src]

Returns true if the document contains 1 or more error(s).

Trait Implementations

impl<T: Clone + PrimaryData> Clone for Document<T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: Debug + PrimaryData> Debug for Document<T>
[src]

[src]

Formats the value using the given formatter.

impl<T: PartialEq + PrimaryData> PartialEq for Document<T>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<T: PrimaryData> Render<T> for Document<T>
[src]

[src]

Attempts to render the given type as a document. Read more