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
Ok
Does not contain errors.
Fields of Ok
data: Data<T> | The primary data of the document. For more information, check out the top level section of the JSON API specification. |
included: Set<Object> | Included resources, resolved from the |
jsonapi: JsonApi | 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. |
links: Map<Key, Link> | 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. |
meta: Map | 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. |
Err
Contains 1 or more error(s).
Fields of Err
errors: Vec<ErrorObject> | |
jsonapi: JsonApi | |
links: Map<Key, Link> | |
meta: Map |
Methods
impl<T: PrimaryData> Document<T>
[src]
fn is_ok(&self) -> bool
[src]
Returns true
if the document does not contain any errors.
fn is_err(&self) -> bool
[src]
Returns true
if the document contains 1 or more error(s).
Trait Implementations
impl<T: Clone + PrimaryData> Clone for Document<T>
[src]
fn clone(&self) -> Document<T>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: Debug + PrimaryData> Debug for Document<T>
[src]
impl<T: PartialEq + PrimaryData> PartialEq for Document<T>
[src]
fn eq(&self, __arg_0: &Document<T>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Document<T>) -> bool
[src]
This method tests for !=
.