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
sourceimpl Enclosure
impl Enclosure
sourcepub fn url(&self) -> &str
pub fn url(&self) -> &str
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");
sourcepub fn set_url<V>(&mut self, url: V) where
V: Into<String>,
pub fn set_url<V>(&mut self, url: V) where
V: Into<String>,
Set the URL of this enclosure.
Examples
use rss::Enclosure;
let mut enclosure = Enclosure::default();
enclosure.set_url("http://example.com/audio.mp3");
sourcepub fn length(&self) -> &str
pub fn length(&self) -> &str
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");
sourcepub fn set_length<V>(&mut self, length: V) where
V: Into<String>,
pub fn set_length<V>(&mut self, length: V) where
V: Into<String>,
Set the content length of this enclosure.
Examples
use rss::Enclosure;
let mut enclosure = Enclosure::default();
enclosure.set_length("1000");
sourcepub fn mime_type(&self) -> &str
pub fn mime_type(&self) -> &str
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");
sourcepub fn set_mime_type<V>(&mut self, mime_type: V) where
V: Into<String>,
pub fn set_mime_type<V>(&mut self, mime_type: V) where
V: Into<String>,
Set the MIME type of this enclosure.
Examples
use rss::Enclosure;
let mut enclosure = Enclosure::default();
enclosure.set_mime_type("audio/mpeg");
Trait Implementations
impl StructuralPartialEq for Enclosure
Auto Trait Implementations
impl RefUnwindSafe for Enclosure
impl Send for Enclosure
impl Sync for Enclosure
impl Unpin for Enclosure
impl UnwindSafe for Enclosure
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more