[−][src]Struct atom_syndication::Content
Represents the content of an Atom entry
Fields
value: Option<String>
The text value of the content.
src: Option<String>
The URI of where the content can be found.
content_type: Option<String>
Either "text", "html", "xhtml", or the MIME type of the content.
Implementations
impl Content
[src]
pub 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"));
pub 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());
pub 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"));
pub 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());
pub 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"));
pub 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 Clone for Content
[src]
impl Debug for Content
[src]
impl Default for Content
[src]
impl PartialEq<Content> for Content
[src]
impl StructuralPartialEq for Content
[src]
Auto Trait Implementations
impl RefUnwindSafe for Content
impl Send for Content
impl Sync for Content
impl Unpin for Content
impl UnwindSafe for Content
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>,