pub struct Enclosure {
    pub url: String,
    pub length: String,
    pub mime_type: String,
}
Expand description

Represents an enclosure in an RSS item.

Fields

url: String

The URL of the enclosure.

length: String

The length of the enclosure in bytes.

mime_type: String

The MIME type of the enclosure.

Implementations

Return the URL of this enclosure.

Examples
use rss::Enclosure;

let mut enclosure = Enclosure::default();
enclosure.set_url("http://example.com/audio.mp3");
assert_eq!(enclosure.url(), "http://example.com/audio.mp3");

Set the URL of this enclosure.

Examples
use rss::Enclosure;

let mut enclosure = Enclosure::default();
enclosure.set_url("http://example.com/audio.mp3");

Return the content length of this enclosure.

Examples
use rss::Enclosure;

let mut enclosure = Enclosure::default();
enclosure.set_length("1000");
assert_eq!(enclosure.length(), "1000");

Set the content length of this enclosure.

Examples
use rss::Enclosure;

let mut enclosure = Enclosure::default();
enclosure.set_length("1000");

Return the MIME type of this enclosure.

Examples
use rss::Enclosure;

let mut enclosure = Enclosure::default();
enclosure.set_mime_type("audio/mpeg");
assert_eq!(enclosure.mime_type(), "audio/mpeg");

Set the MIME type of this enclosure.

Examples
use rss::Enclosure;

let mut enclosure = Enclosure::default();
enclosure.set_mime_type("audio/mpeg");

Builds an Enclosure from source XML

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 ==. Read more

This method tests for !=.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.