[−][src]Struct atom_syndication::Link
Represents a link in an Atom feed
Fields
href: String
The URI of the referenced resource.
rel: String
The link relationship type.
hreflang: Option<String>
The language of the resource.
mime_type: Option<String>
The MIME type of the resource.
title: Option<String>
Human-readable information about the link.
length: Option<String>
The length of the resource, in bytes.
Implementations
impl Link
[src]
pub fn href(&self) -> &str
[src]
Return the URI the referenced resource.
Examples
use atom_syndication::Link; let mut link = Link::default(); link.set_href("http://example.com"); assert_eq!(link.href(), "http://example.com");
pub fn set_href<V>(&mut self, href: V) where
V: Into<String>,
[src]
V: Into<String>,
Set the URI of the referenced resource.
Examples
use atom_syndication::Link; let mut link = Link::default(); link.set_href("http://example.com");
pub fn rel(&self) -> &str
[src]
Return the relation type of this link.
Examples
use atom_syndication::Link; let mut link = Link::default(); link.set_rel("alternate"); assert_eq!(link.rel(), "alternate");
pub fn set_rel<V>(&mut self, rel: V) where
V: Into<String>,
[src]
V: Into<String>,
Set the relation type of this link.
Examples
use atom_syndication::Link; let mut link = Link::default(); link.set_rel("alternate");
pub fn hreflang(&self) -> Option<&str>
[src]
Return the language of the referenced resource.
Examples
use atom_syndication::Link; let mut link = Link::default(); link.set_hreflang("en".to_string()); assert_eq!(link.hreflang(), Some("en"));
pub fn set_hreflang<V>(&mut self, hreflang: V) where
V: Into<Option<String>>,
[src]
V: Into<Option<String>>,
Set the language of the referenced resource.
Examples
use atom_syndication::Link; let mut link = Link::default(); link.set_hreflang("en".to_string());
pub fn mime_type(&self) -> Option<&str>
[src]
Return the MIME type of the referenced resource.
Examples
use atom_syndication::Link; let mut link = Link::default(); link.set_mime_type("text/html".to_string()); assert_eq!(link.mime_type(), Some("text/html"));
pub fn set_mime_type<V>(&mut self, mime_type: V) where
V: Into<Option<String>>,
[src]
V: Into<Option<String>>,
Set the MIME type of the referenced resource.
Examples
use atom_syndication::Link; let mut link = Link::default(); link.set_mime_type("text/html".to_string());
pub fn title(&self) -> Option<&str>
[src]
Return the title of the referenced resource.
Examples
use atom_syndication::Link; let mut link = Link::default(); link.set_title("Article Title".to_string()); assert_eq!(link.title(), Some("Article Title"));
pub fn set_title<V>(&mut self, title: V) where
V: Into<Option<String>>,
[src]
V: Into<Option<String>>,
Set the title of the referenced resource.
Examples
use atom_syndication::Link; let mut link = Link::default(); link.set_title("Article Title".to_string());
pub fn length(&self) -> Option<&str>
[src]
Return the content length of the referenced resource in bytes.
Examples
use atom_syndication::Link; let mut link = Link::default(); link.set_length("1000".to_string()); assert_eq!(link.length(), Some("1000"));
pub fn set_length<V>(&mut self, length: V) where
V: Into<Option<String>>,
[src]
V: Into<Option<String>>,
Set the content length of the referenced resource in bytes.
Examples
use atom_syndication::Link; let mut link = Link::default(); link.set_length("1000".to_string());
Trait Implementations
impl Clone for Link
[src]
impl Debug for Link
[src]
impl Default for Link
[src]
impl PartialEq<Link> for Link
[src]
impl StructuralPartialEq for Link
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,