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

href: String

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.

templated: bool

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.

media_type: Option<String>

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.

deprecation: Option<String>

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.

name: Option<String>

The "name" property is OPTIONAL.

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

profile: Option<String>

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.

title: Option<String>

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]).

hreflang: Option<String>

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]

pub fn new<S>(href: S) -> HalLink where
    S: Into<String>, 
[src]

pub fn templated(self, templated: bool) -> Self[src]

pub fn with_media_type(self, media_type: &str) -> Self[src]

pub fn media_type(&self) -> Option<String>[src]

pub fn with_deprecation(self, deprecation: &str) -> Self[src]

pub fn deprecation(&self) -> Option<String>[src]

pub fn with_name(self, name: &str) -> Self[src]

pub fn name(&self) -> Option<String>[src]

pub fn with_profile(self, profile: &str) -> Self[src]

pub fn profile(&self) -> Option<String>[src]

pub fn with_title(self, title: &str) -> Self[src]

pub fn title(&self) -> Option<String>[src]

pub fn with_hreflang(self, hreflang: &str) -> Self[src]

pub fn hreflang(&self) -> Option<String>[src]

Trait Implementations

impl PartialEq<HalLink> for HalLink[src]

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

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl Clone for HalLink[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

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

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> From for T[src]

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

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

type Owned = T

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

type Error = !

🔬 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> BorrowMut for T where
    T: ?Sized
[src]

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

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

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

The type returned in the event of a conversion error.

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