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: StringThe 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: MapThe “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: MapThe “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§impl Clone for JsonResourceDescriptorLink
impl Clone for JsonResourceDescriptorLink
Source§fn clone(&self) -> JsonResourceDescriptorLink
fn clone(&self) -> JsonResourceDescriptorLink
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more