pub struct Content {
    pub base: Option<String>,
    pub lang: Option<String>,
    pub value: Option<String>,
    pub src: Option<String>,
    pub content_type: Option<String>,
}
Expand description

Represents the content of an Atom entry

Fields§

§base: Option<String>

Base URL for resolving any relative references found in the element.

§lang: Option<String>

Indicates the natural language for the element.

§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§

Return base URL of the content.

Set base URL of the content.

Return natural language of the content.

Set the base URL of the content.

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"));

Set the text value of the content.

Examples
use atom_syndication::Content;

let mut content = Content::default();
content.set_value("Example content".to_string());

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"));

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());

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"));

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§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.