Struct atom_syndication::Link
[−]
[src]
pub struct Link { /* fields omitted */ }
Represents a link in an Atom feed
Methods
impl Link
[src]
fn href(&self) -> &str
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");
fn set_href<V>(&mut self, href: V) where
V: Into<String>,
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");
fn rel(&self) -> &str
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");
fn set_rel<V>(&mut self, rel: V) where
V: Into<String>,
V: Into<String>,
Set the relation type of this link.
Examples
use atom_syndication::Link; let mut link = Link::default(); link.set_rel("alternate");
fn hreflang(&self) -> Option<&str>
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"));
fn set_hreflang<V>(&mut self, hreflang: V) where
V: Into<Option<String>>,
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());
fn mime_type(&self) -> Option<&str>
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"));
fn set_mime_type<V>(&mut self, mime_type: V) where
V: Into<Option<String>>,
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());
fn title(&self) -> Option<&str>
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"));
fn set_title<V>(&mut self, title: V) where
V: Into<Option<String>>,
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());
fn length(&self) -> Option<&str>
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"));
fn set_length<V>(&mut self, length: V) where
V: Into<Option<String>>,
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 Debug for Link
[src]
impl Clone for Link
[src]
fn clone(&self) -> Link
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialEq for Link
[src]
fn eq(&self, __arg_0: &Link) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Link) -> bool
This method tests for !=
.