Struct atom_syndication::Link [−][src]
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>,
}Expand description
Represents a link in an Atom feed
Fields
href: StringThe URI of the referenced resource.
rel: StringThe 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
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");
Set the URI of the referenced resource.
Examples
use atom_syndication::Link; let mut link = Link::default(); link.set_href("http://example.com");
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");
Set the relation type of this link.
Examples
use atom_syndication::Link; let mut link = Link::default(); link.set_rel("alternate");
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"));
Set the language of the referenced resource.
Examples
use atom_syndication::Link; let mut link = Link::default(); link.set_hreflang("en".to_string());
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"));
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());
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"));
Set the title of the referenced resource.
Examples
use atom_syndication::Link; let mut link = Link::default(); link.set_title("Article Title".to_string());
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"));
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Linkimpl UnwindSafe for LinkBlanket Implementations
Mutably borrows from an owned value. Read more