[−][src]Struct rustic_hal::link::HalLink
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]
impl HalLink
pub fn new<S>(href: S) -> HalLink where
S: Into<String>,
[src]
pub fn new<S>(href: S) -> HalLink where
S: Into<String>,
pub fn templated(self, templated: bool) -> Self
[src]
pub fn templated(self, templated: bool) -> Self
pub fn with_media_type(self, media_type: &str) -> Self
[src]
pub fn with_media_type(self, media_type: &str) -> Self
pub fn media_type(&self) -> Option<String>
[src]
pub fn media_type(&self) -> Option<String>
pub fn with_deprecation(self, deprecation: &str) -> Self
[src]
pub fn with_deprecation(self, deprecation: &str) -> Self
pub fn deprecation(&self) -> Option<String>
[src]
pub fn deprecation(&self) -> Option<String>
pub fn with_name(self, name: &str) -> Self
[src]
pub fn with_name(self, name: &str) -> Self
pub fn name(&self) -> Option<String>
[src]
pub fn name(&self) -> Option<String>
pub fn with_profile(self, profile: &str) -> Self
[src]
pub fn with_profile(self, profile: &str) -> Self
pub fn profile(&self) -> Option<String>
[src]
pub fn profile(&self) -> Option<String>
pub fn with_title(self, title: &str) -> Self
[src]
pub fn with_title(self, title: &str) -> Self
pub fn title(&self) -> Option<String>
[src]
pub fn title(&self) -> Option<String>
pub fn with_hreflang(self, hreflang: &str) -> Self
[src]
pub fn with_hreflang(self, hreflang: &str) -> Self
pub fn hreflang(&self) -> Option<String>
[src]
pub fn hreflang(&self) -> Option<String>
Trait Implementations
impl PartialEq<HalLink> for HalLink
[src]
impl PartialEq<HalLink> for HalLink
Two links are the same if their href is the same The rest is immaterial
fn eq(&self, other: &HalLink) -> bool
[src]
fn eq(&self, other: &HalLink) -> bool
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<T> From<T> for HalLink where
T: Into<String>,
[src]
impl<T> From<T> for HalLink where
T: Into<String>,
impl Clone for HalLink
[src]
impl Clone for HalLink
fn clone(&self) -> HalLink
[src]
fn clone(&self) -> HalLink
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for HalLink
[src]
impl Debug for HalLink
impl Serialize for HalLink
[src]
impl Serialize for HalLink
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
impl<'de> Deserialize<'de> for HalLink
[src]
impl<'de> Deserialize<'de> for HalLink
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,