Struct json_api::doc::Relationship
[−]
[src]
pub struct Relationship { pub data: Data<Identifier>, pub links: Map<Key, Link>, pub meta: Map, // some fields omitted }
Represents a resource's relationship to another.
For more information, check out the relationships section of the JSON API specification.
Fields
data: Data<Identifier>
Contains resource linkage. For more information, checkout the resource linkage 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.
Methods
impl Relationship
[src]
fn new(data: Data<Identifier>) -> Self
[src]
Returns a new Relationship
.
Example
use json_api::doc::{Data, Identifier, Relationship}; let ident = Identifier::new("users".parse()?, "1".to_owned()); let data = Data::Member(Box::new(Some(ident))); let mut relationship = Relationship::new(data);
Trait Implementations
impl Clone for Relationship
[src]
fn clone(&self) -> Relationship
[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 Relationship
[src]
impl PartialEq for Relationship
[src]
fn eq(&self, __arg_0: &Relationship) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Relationship) -> bool
[src]
This method tests for !=
.
impl From<Option<Identifier>> for Relationship
[src]
fn from(value: Option<Identifier>) -> Self
[src]
Performs the conversion.
impl From<Vec<Identifier>> for Relationship
[src]
fn from(value: Vec<Identifier>) -> Self
[src]
Performs the conversion.
impl From<Identifier> for Relationship
[src]
fn from(value: Identifier) -> Self
[src]
Performs the conversion.
impl FromIterator<Identifier> for Relationship
[src]
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = Identifier>,
[src]
I: IntoIterator<Item = Identifier>,
Creates a value from an iterator. Read more