#[non_exhaustive]pub struct AtomLink {
pub href: String,
pub rel: String,
pub mime_type: String,
pub length: String,
pub title: String,
}Expand description
An Atom <link> element per RFC 4287 §4.2.7.
Atom links are typed pointers; the canonical alternate link to the
resource is rel="alternate" and self-references use rel="self". Media
enclosures (e.g. podcasts) use rel="enclosure" together with the type
and length attributes.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.href: StringTarget URI of the link.
rel: StringLink relation (alternate, self, enclosure, …). Empty means
alternate, per RFC 4287 §4.2.7.2.
mime_type: StringMIME type of the linked resource.
length: StringLength in bytes (relevant for rel="enclosure").
title: StringOptional human-readable title.
Implementations§
Source§impl AtomLink
impl AtomLink
Sourcepub fn alternate<S: Into<String>>(href: S) -> Self
pub fn alternate<S: Into<String>>(href: S) -> Self
Constructs an AtomLink with the given href, defaulting to
rel="alternate".
Sourcepub fn self_ref<S: Into<String>>(href: S) -> Self
pub fn self_ref<S: Into<String>>(href: S) -> Self
Constructs a rel="self" link pointing at the canonical location of
the feed.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AtomLink
impl<'de> Deserialize<'de> for AtomLink
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
impl Eq for AtomLink
impl StructuralPartialEq for AtomLink
Auto Trait Implementations§
impl Freeze for AtomLink
impl RefUnwindSafe for AtomLink
impl Send for AtomLink
impl Sync for AtomLink
impl Unpin for AtomLink
impl UnsafeUnpin for AtomLink
impl UnwindSafe for AtomLink
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