[][src]Struct rustic_hal::link::HalLink

pub struct HalLink {
    pub href: String,
    pub templated: bool,
    pub media_type: Option<String>,
    pub deprecation: Option<String>,
    pub name: Option<String>,
    pub profile: Option<String>,
    pub title: Option<String>,
    pub hreflang: Option<String>,
}

A Link object for linking HAL Resources.

The link represents a related resource. If follows the HAL Draft Spec

Examples

use rustic_hal::HalLink;

let link = HalLink::new("http://sowewhere.com");

Fields

The "href" property is REQUIRED.

Its value is either a URI [RFC3986] or a URI Template [RFC6570].

If the value is a URI Template then the Link Object SHOULD have a "templated" attribute whose value is true.

The "templated" property is OPTIONAL.

Its value is boolean and SHOULD be true when the Link Object's "href" property is a URI Template.

Its value SHOULD be considered false if it is undefined or any other value than true.

The "type" property is OPTIONAL.

Its value is a string used as a hint to indicate the media type expected when dereferencing the target resource.

The "deprecation" property is OPTIONAL.

Its presence indicates that the link is to be deprecated (i.e. removed) at a future date. Its value is a URL that SHOULD provide further information about the deprecation.

A client SHOULD provide some notification (for example, by logging a warning message) whenever it traverses over a link that has this property. The notification SHOULD include the deprecation property's value so that a client manitainer can easily find information about the deprecation.

The "name" property is OPTIONAL.

Its value MAY be used as a secondary key for selecting Link Objects which share the same relation type.

The "profile" property is OPTIONAL.

Its value is a string which is a URI that hints about the profile (as defined by [I-D.wilde-profile-link]) of the target resource.

The "title" property is OPTIONAL.

Its value is a string and is intended for labelling the link with a human-readable identifier (as defined by [RFC5988]).

The "hreflang" property is OPTIONAL.

Its value is a string and is intended for indicating the language of the target resource (as defined by [RFC5988]).

Methods

impl HalLink
[src]

Trait Implementations

impl PartialEq<HalLink> for HalLink
[src]

Two links are the same if their href is the same The rest is immaterial

This method tests for !=.

impl<T> From<T> for HalLink where
    T: Into<String>, 
[src]

impl Clone for HalLink
[src]

Performs copy-assignment from source. Read more

impl Debug for HalLink
[src]

impl Serialize for HalLink
[src]

impl<'de> Deserialize<'de> for HalLink
[src]

Auto Trait Implementations

impl Send for HalLink

impl Sync for HalLink

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

impl<T> From for T
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

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