pub struct Link {
pub href: String,
pub rel: String,
pub type: Option<String>,
pub hreflang: Option<String>,
pub title: Option<String>,
pub length: Option<i64>,
}Expand description
Hyperlink to enable Hypermedia Access
Fields§
§href: StringSupplies the URI to a remote resource (or resource fragment).
rel: StringThe type or semantics of the relation.
type: Option<String>A hint indicating what the media type of the result of dereferencing the link should be.
hreflang: Option<String>A hint indicating what the language of the result of dereferencing the link should be.
title: Option<String>Used to label the destination of a link such that it can be used as a human-readable identifier.
length: Option<i64>Implementations§
source§impl Link
impl Link
sourcepub fn new(href: impl ToString, rel: impl ToString) -> Link
pub fn new(href: impl ToString, rel: impl ToString) -> Link
Constructs a new Link with the given href and link relation
sourcepub fn mediatype(self, mime: impl ToString) -> Link
pub fn mediatype(self, mime: impl ToString) -> Link
Sets the media type of the Link and returns the Value
sourcepub fn language(self, language: impl ToString) -> Link
pub fn language(self, language: impl ToString) -> Link
Sets the language of the Link and returns the Value
Trait Implementations§
source§impl<'de> Deserialize<'de> for Link
impl<'de> Deserialize<'de> for Link
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<Link> for Link
impl PartialEq<Link> for Link
impl Eq for Link
impl StructuralEq for Link
impl StructuralPartialEq for Link
Auto Trait Implementations§
impl RefUnwindSafe for Link
impl Send for Link
impl Sync for Link
impl Unpin for Link
impl UnwindSafe for Link
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more