[−][src]Struct rss::Image
Represents an image in an RSS feed.
Fields
url: String
The URL of the image.
title: String
A description of the image. This is used in the HTML alt
attribute.
link: String
The URL that the image links to.
width: Option<String>
The width of the image.
height: Option<String>
The height of the image.
description: Option<String>
The text for the HTML title
attribute of the link formed around the image.
Implementations
impl Image
[src]
pub fn url(&self) -> &str
[src]
Return the URL of this image.
Examples
use rss::Image; let mut image = Image::default(); image.set_url("http://example.com/image.png"); assert_eq!(image.url(), "http://example.com/image.png");
pub fn set_url<V>(&mut self, url: V) where
V: Into<String>,
[src]
V: Into<String>,
Set the URL of this image.
Examples
use rss::Image; let mut image = Image::default(); image.set_url("http://example.com/image.png");
pub fn title(&self) -> &str
[src]
Return the description of this image.
This is used in the HTML alt
attribute.
Examples
use rss::Image; let mut image = Image::default(); image.set_title("Example image"); assert_eq!(image.title(), "Example image");
pub fn set_title<V>(&mut self, title: V) where
V: Into<String>,
[src]
V: Into<String>,
Set the description of this image.
This is used in the HTML alt
attribute.
Examples
use rss::Image; let mut image = Image::default(); image.set_title("Example image");
pub fn link(&self) -> &str
[src]
Return the URL that this image links to.
Examples
use rss::Image; let mut image = Image::default(); image.set_link("http://example.com"); assert_eq!(image.link(), "http://example.com");
pub fn set_link<V>(&mut self, link: V) where
V: Into<String>,
[src]
V: Into<String>,
Set the URL that this image links to.
Examples
use rss::Image; let mut image = Image::default(); image.set_link("http://example.com");
pub fn width(&self) -> Option<&str>
[src]
Return the width of this image.
If the width is None
the default value should be considered to be 80
.
Examples
use rss::Image; let mut image = Image::default(); image.set_width("80".to_string()); assert_eq!(image.width(), Some("80"));
pub fn set_width<V>(&mut self, width: V) where
V: Into<Option<String>>,
[src]
V: Into<Option<String>>,
Set the width of this image.
Examples
use rss::Image; let mut image = Image::default(); image.set_width("80".to_string());
pub fn height(&self) -> Option<&str>
[src]
Return the height of this image.
If the height is None
the default value should be considered to be 31
.
Examples
use rss::Image; let mut image = Image::default(); image.set_height("31".to_string()); assert_eq!(image.height(), Some("31"));
pub fn set_height<V>(&mut self, height: V) where
V: Into<Option<String>>,
[src]
V: Into<Option<String>>,
Set the height of this image.
If the height is None
the default value should be considered to be 31
.
Examples
use rss::Image; let mut image = Image::default(); image.set_height("31".to_string());
pub fn description(&self) -> Option<&str>
[src]
Return the title for the link formed around this image.
Examples
use rss::Image; let mut image = Image::default(); image.set_description("Example Title".to_string()); assert_eq!(image.description(), Some("Example Title"));
pub fn set_description<V>(&mut self, description: V) where
V: Into<Option<String>>,
[src]
V: Into<Option<String>>,
Set the title for the link formed around this image.
Examples
use rss::Image; let mut image = Image::default(); image.set_description("Example Title".to_string());
impl Image
[src]
pub fn from_xml<R: BufRead>(
reader: &mut Reader<R>,
_: Attributes<'_>
) -> Result<Self, Error>
[src]
reader: &mut Reader<R>,
_: Attributes<'_>
) -> Result<Self, Error>
Builds an Image from source XML
Trait Implementations
impl Clone for Image
[src]
impl Debug for Image
[src]
impl Default for Image
[src]
impl PartialEq<Image> for Image
[src]
impl StructuralPartialEq for Image
[src]
Auto Trait Implementations
impl RefUnwindSafe for Image
[src]
impl Send for Image
[src]
impl Sync for Image
[src]
impl Unpin for Image
[src]
impl UnwindSafe for Image
[src]
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,
pub 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,