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

Contains resource linkage. For more information, checkout the resource linkage 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.

Methods

impl Relationship
[src]

[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]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Relationship
[src]

[src]

Formats the value using the given formatter.

impl PartialEq for Relationship
[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 From<Option<Identifier>> for Relationship
[src]

[src]

Performs the conversion.

impl From<Vec<Identifier>> for Relationship
[src]

[src]

Performs the conversion.

impl From<Identifier> for Relationship
[src]

[src]

Performs the conversion.

impl FromIterator<Identifier> for Relationship
[src]

[src]

Creates a value from an iterator. Read more