[][src]Struct atom_syndication::Link

pub struct Link {
    pub href: String,
    pub rel: String,
    pub hreflang: Option<String>,
    pub mime_type: Option<String>,
    pub title: Option<String>,
    pub length: Option<String>,
}

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]

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]

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]

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]

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]

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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.