Struct atom_syndication::Content
[−]
[src]
pub struct Content { /* fields omitted */ }
Represents the content of an Atom entry
Methods
impl Content
[src]
fn value(&self) -> Option<&str>
[src]
Return the text value of the content.
If the content_type
is neither "text"
, "html"
, or "xhtml"
then the value should
be a base64 encoded document of the indicated MIME type.
Examples
use atom_syndication::Content; let mut content = Content::default(); content.set_value("Example content".to_string()); assert_eq!(content.value(), Some("Example content"));
fn set_value<V>(&mut self, value: V) where
V: Into<Option<String>>,
[src]
V: Into<Option<String>>,
Set the text value of the content.
Examples
use atom_syndication::Content; let mut content = Content::default(); content.set_value("Example content".to_string());
fn src(&self) -> Option<&str>
[src]
Return the URI where the content can be found.
Examples
use atom_syndication::Content; let mut content = Content::default(); content.set_src("http://example.com/content.html".to_string()); assert_eq!(content.src(), Some("http://example.com/content.html"));
fn set_src<V>(&mut self, src: V) where
V: Into<Option<String>>,
[src]
V: Into<Option<String>>,
Set the URI where the content can be found.
Examples
use atom_syndication::Content; let mut content = Content::default(); content.set_src("http://example.com/content.html".to_string());
fn content_type(&self) -> Option<&str>
[src]
Return the type of the content.
The type is either "text"
, "html"
, "xhtml"
, or the MIME type of the content.
Examples
use atom_syndication::Content; let mut content = Content::default(); content.set_content_type("image/png".to_string()); assert_eq!(content.content_type(), Some("image/png"));
fn set_content_type<V>(&mut self, content_type: V) where
V: Into<Option<String>>,
[src]
V: Into<Option<String>>,
Set the type of the content.
Examples
use atom_syndication::Content; let mut content = Content::default(); content.set_content_type("image/png".to_string()); assert_eq!(content.content_type(), Some("image/png"));
Trait Implementations
impl Debug for Content
[src]
impl Default for Content
[src]
impl Clone for Content
[src]
fn clone(&self) -> Content
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more