Struct json_api::doc::Identifier
[−]
[src]
pub struct Identifier { pub id: String, pub kind: Key, pub meta: Map, // some fields omitted }
Identifies an individual resource. Commonly found in an object's relationships.
Identifiers share their equality and hashing behavior with Object
. For more
information, check out the resource identifier objects section of the
JSON API specification.
Fields
id: String
A string that contains a unique identfier for this resource type (kind
). For
more information, check out the identification section of the JSON API
specification.
kind: Key
Describes 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.
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.
Methods
impl Identifier
[src]
fn new(kind: Key, id: String) -> Self
[src]
Returns a new Identifier
.
Example
use json_api::doc::Identifier; let mut ident = Identifier::new("users".parse()?, "1".to_owned());
Trait Implementations
impl Clone for Identifier
[src]
fn clone(&self) -> Identifier
[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 Debug for Identifier
[src]
impl Eq for Identifier
[src]
impl From<Object> for Identifier
[src]
impl<'a> From<&'a Object> for Identifier
[src]
impl Hash for Identifier
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl PartialEq for Identifier
[src]
fn eq(&self, rhs: &Identifier) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PartialEq<Object> for Identifier
[src]
fn eq(&self, rhs: &Object) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Render<Identifier> for Identifier
[src]
fn render(self, _: Option<&Query>) -> Result<Document<Identifier>, Error>
[src]
Attempts to render the given type as a document. Read more