JsonResourceDescriptorLink

Struct JsonResourceDescriptorLink 

Source
pub struct JsonResourceDescriptorLink {
    pub rel: String,
    pub link_type: Option<String>,
    pub href: Option<String>,
    pub titles: Map,
    pub properties: Map,
}
Expand description

Each of these link objects can have the following members:

  • rel
  • type
  • href
  • titles
  • properties

The “rel” and “href” members are strings representing the link’s relation type and the target URI, respectively. The context of the link is the “subject”. The “type” member is a string indicating what the media type of the result of dereferencing the link ought to be. The order of elements in the “links” array MAY be interpreted as indicating an of preference. Thus, if there are two or more link relations having the same “rel” value, the first link relation would indicate the user’s preferred link.

Fields§

§rel: String

The value of the “rel” member is a string that is either a URI or a registered relation type (see RFC 8288).

The value of the “rel” member MUST contain exactly one URI or registered relation type. The URI or registered relation type identifies the type of the link relation. The other members of the object have meaning only once the type of link relation is understood. In some instances, the link relation will have associated semantics enabling the client to query for other resources on the Internet. In other instances, the link relation will have associated semantics enabling the client to utilize the other members of the link relation object without fetching additional external resources. URI link relation type values are compared using the “Simple String Comparison” algorithm of Section 6.2.1 of RFC 3986.

The “rel” member MUST be present in a link relation object.

§link_type: Option<String>

The value of the “type” member is a string that indicates the media type of the target resource (see RFC 6838). The “type” member is OPTIONAL in a link relation object.

§href: Option<String>

The value of the “href” member is a string that contains an URI pointing to the linked resource. The “href” member is optional in the link relation object.

§titles: Map

The “titles” object comprises zero or more name/value pairs whose names are a language tag or the string “und”.

The string is human-readable and describes the link relation. More than one title for the link relation MAY be provided for the benefit of users who utilize the link relation, and, if used, a language identifier SHOULD be duly used as the name. If the language is unknown or unspecified, then the name is “und”.

A JRD SHOULD NOT include more than one title named with the same language tag (or “und”) within the link relation object. Meaning is undefined if a link relation object includes more than one title identified with the same language tag (or “und”), though this MUST NOT be treated as an error. A client MAY select whichever title or titles it wishes to utilize.

Here is an example of the “titles” object:

  "titles" :
  {
    "und" : "The Magical World of Steve",
    "en-us" : "The Magical World of Steve",
    "fr" : "Le Monde Magique de Steve"
  }

The “titles” member is OPTIONAL in a link relation object.

§properties: Map

The “properties” object within the link relation object comprises zero or more name/value pairs whose names are URIs (referred to as “property identifiers”) and whose values are strings or null.

Properties are used to convey additional information about the link relation. As an example, consider this use of “properties”:

  "properties" : { "http://packetizer.com/ns/port" : "993" }

The “properties” member is optional in a link relation object.

Trait Implementations§

Source§

fn clone(&self) -> JsonResourceDescriptorLink

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

fn default() -> JsonResourceDescriptorLink

Returns the “default value” for a type. Read more
Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

fn eq(&self, other: &JsonResourceDescriptorLink) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,