pub struct Link {
pub href: String,
pub rel: Option<String>,
pub link_type: Option<String>,
pub title: Option<String>,
pub length: Option<u64>,
pub hreflang: Option<String>,
}Expand description
Link in feed or entry
Fields§
§href: StringLink URL
rel: Option<String>Link relationship type (e.g., “alternate”, “enclosure”, “self”)
link_type: Option<String>MIME type of the linked resource
title: Option<String>Human-readable link title
length: Option<u64>Length of the linked resource in bytes
hreflang: Option<String>Language of the linked resource
Implementations§
Source§impl Link
impl Link
Sourcepub fn new(href: impl Into<String>, rel: impl Into<String>) -> Self
pub fn new(href: impl Into<String>, rel: impl Into<String>) -> Self
Create a new link with just URL and relation type
Sourcepub fn alternate(href: impl Into<String>) -> Self
pub fn alternate(href: impl Into<String>) -> Self
Create an alternate link (common for entry URLs)
Sourcepub fn self_link(href: impl Into<String>, mime_type: impl Into<String>) -> Self
pub fn self_link(href: impl Into<String>, mime_type: impl Into<String>) -> Self
Create a self link (for feed URLs)
Sourcepub fn enclosure(href: impl Into<String>, mime_type: Option<String>) -> Self
pub fn enclosure(href: impl Into<String>, mime_type: Option<String>) -> Self
Create an enclosure link (for media)
Create a related link
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Link
impl RefUnwindSafe for Link
impl Send for Link
impl Sync for Link
impl Unpin for Link
impl UnwindSafe for Link
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)