Struct rss::ChannelBuilder
[−]
[src]
pub struct ChannelBuilder { /* fields omitted */ }
A builder used to create a Channel
.
Methods
impl ChannelBuilder
[src]
fn from_channel(channel: Channel) -> Result<Self, Error>
Construct a new ChannelBuilder
using the values from an existing Channel
.
Examples
use rss::{Channel, ChannelBuilder}; let input = include_str!("tests/data/channel.xml"); let channel = input.parse::<Channel>().unwrap(); let builder = ChannelBuilder::from_channel(channel.clone()).unwrap();
Errors
If this function encounters an error while parsing ttl
or skip_hours
from a String
to an i64
it will return an IntParsing
error.
fn title<S>(self, title: S) -> ChannelBuilder where
S: Into<String>,
S: Into<String>,
Set the title of the Channel
.
Examples
use rss::ChannelBuilder; let builder = ChannelBuilder::default() .title("The Linux Action Show! OGG");
fn link<S>(self, link: S) -> ChannelBuilder where
S: Into<String>,
S: Into<String>,
Set the web site URL for the Channel
.
Examples
use rss::ChannelBuilder; let builder = ChannelBuilder::default() .link("http://www.jupiterbroadcasting.com");
fn description<S>(self, description: S) -> ChannelBuilder where
S: Into<String>,
S: Into<String>,
Set the description of the Channel
.
Examples
use rss::ChannelBuilder; let builder = ChannelBuilder::default() .description("Ogg Vorbis audio versions of The Linux Action Show!");
fn language<V>(self, language: V) -> ChannelBuilder where
V: Into<Option<String>>,
V: Into<Option<String>>,
Set the language of the Channel
.
Examples
use rss::ChannelBuilder; let builder = ChannelBuilder::default() .language("en".to_string());
fn copyright<V>(self, copyright: V) -> ChannelBuilder where
V: Into<Option<String>>,
V: Into<Option<String>>,
Set the copyright notice for the content of the Channel
.
Examples
use rss::ChannelBuilder; let builder = ChannelBuilder::default() .copyright("Copyright 2002, Spartanburg Herald-Journal".to_string());
fn managing_editor<V>(self, managing_editor: V) -> ChannelBuilder where
V: Into<Option<String>>,
V: Into<Option<String>>,
Set the email address for the managing editor of the Channel
.
Examples
use rss::ChannelBuilder; let builder = ChannelBuilder::default() .managing_editor("chris@jupiterbroadcasting.com (Chris Fisher)".to_string());
fn webmaster<V>(self, webmaster: V) -> ChannelBuilder where
V: Into<Option<String>>,
V: Into<Option<String>>,
Set the email address for the webmaster of the Channel
.
Examples
use rss::ChannelBuilder; let builder = ChannelBuilder::default() .webmaster("chris@jupiterbroadcasting.com (Chris Fisher)".to_string());
fn pub_date<V>(self, pub_date: V) -> ChannelBuilder where
V: Into<Option<String>>,
V: Into<Option<String>>,
Set the publication date for the content of the Channel
.
Examples
use rss::ChannelBuilder; let builder = ChannelBuilder::default() .pub_date("Sun, 13 Mar 2016 20:02:02 -0700".to_string());
fn last_build_date<V>(self, last_build_date: V) -> ChannelBuilder where
V: Into<Option<String>>,
V: Into<Option<String>>,
Set the time that the content of the Channel
was last changed.
Examples
use rss::ChannelBuilder; let builder = ChannelBuilder::default() .last_build_date("Sun, 13 Mar 2016 20:02:02 -0700".to_string());
fn categories<V>(self, categories: V) -> ChannelBuilder where
V: Into<Vec<Category>>,
V: Into<Vec<Category>>,
Set the categories that the Channel
belongs to.
Examples
use rss::{ChannelBuilder, CategoryBuilder}; let category = CategoryBuilder::default() .name("Podcast") .finalize(); let builder = ChannelBuilder::default() .categories(vec![category]);
fn generator<V>(self, generator: V) -> ChannelBuilder where
V: Into<Option<String>>,
V: Into<Option<String>>,
Set the name of the program used to generate the contents of the Channel
.
Examples
use rss::ChannelBuilder; let generator = "Feeder 2.5.12(2294); Mac OS X Version 10.9.5 (Build 13F34) \ http://reinventedsoftware.com/feeder/".to_string(); let builder = ChannelBuilder::default() .generator(generator);
fn docs<V>(self, docs: V) -> ChannelBuilder where
V: Into<Option<String>>,
V: Into<Option<String>>,
Set the URL that points to the documentation of the RSS format used in the Channel
.
Examples
use rss::ChannelBuilder; let builder = ChannelBuilder::default() .docs("http://blogs.law.harvard.edu/tech/rss/".to_string());
fn cloud<V>(self, cloud: V) -> ChannelBuilder where
V: Into<Option<Cloud>>,
V: Into<Option<Cloud>>,
Set the information used to register with a cloud for notifications of updates to the
Channel
Examples
use rss::{ChannelBuilder, CloudBuilder}; let cloud = CloudBuilder::default() .domain("http://rpc.sys.com/") .protocol("soap") .finalize(); let builder = ChannelBuilder::default() .cloud(cloud);
fn ttl<V>(self, ttl: V) -> ChannelBuilder where
V: Into<Option<i64>>,
V: Into<Option<i64>>,
Set the time to live of the Channel
.
Examples
use rss::ChannelBuilder; let builder = ChannelBuilder::default() .ttl(60);
fn image<V>(self, image: V) -> ChannelBuilder where
V: Into<Option<Image>>,
V: Into<Option<Image>>,
Set the image to be display with the Channel
.
Examples
use rss::{ChannelBuilder, ImageBuilder}; let image = ImageBuilder::default() .url("http://jupiterbroadcasting.com/images/LAS-300-Badge.jpg") .link("http://www.jupiterbroadcasting.com/") .finalize(); let builder = ChannelBuilder::default() .image(image);
fn rating<V>(self, rating: V) -> ChannelBuilder where
V: Into<Option<String>>,
V: Into<Option<String>>,
Set the PICS rating for the Channel
.
Examples
use rss::ChannelBuilder; let builder = ChannelBuilder::default() .rating("PG-13".to_string());
fn text_input<V>(self, text_input: V) -> ChannelBuilder where
V: Into<Option<TextInput>>,
V: Into<Option<TextInput>>,
Set the information for a text box to be displayed with the Channel
.
Examples
use rss::{ChannelBuilder, TextInputBuilder}; let text_input = TextInputBuilder::default() .link("http://www.example.com/feedback") .finalize(); let builder = ChannelBuilder::default() .text_input(text_input);
fn skip_hours<V>(self, skip_hours: V) -> ChannelBuilder where
V: Into<Vec<i64>>,
V: Into<Vec<i64>>,
Set the hours that aggregators can skip for refreshing content.
Examples
use rss::ChannelBuilder; let builder = ChannelBuilder::default() .skip_hours(vec![0, 12, 18]);
fn skip_days<V>(self, skip_days: V) -> ChannelBuilder where
V: Into<Vec<String>>,
V: Into<Vec<String>>,
Set the days that aggregators can skip for refreshing content.
Examples
use rss::ChannelBuilder; let builder = ChannelBuilder::default() .skip_days(vec!["Monday".to_string(), "Tuesday".to_string()]);
fn items<V>(self, items: V) -> ChannelBuilder where
V: Into<Vec<Item>>,
V: Into<Vec<Item>>,
Set the Item
s in this Channel
.
Examples
use rss::{ChannelBuilder, ItemBuilder}; let item = ItemBuilder::default() .title("Making Music with Linux | LAS 408".to_string()) .finalize(); let builder = ChannelBuilder::default() .items(vec![item]);
fn itunes_ext<V>(self, itunes_ext: V) -> ChannelBuilder where
V: Into<Option<ITunesChannelExtension>>,
V: Into<Option<ITunesChannelExtension>>,
Set the ITunesChannelExtension
for the Channel
.
Examples
use rss::ChannelBuilder; use rss::extension::itunes::{ITunesChannelExtensionBuilder, ITunesOwnerBuilder, ITunesCategoryBuilder}; let owner = ITunesOwnerBuilder::default() .email("email@example.com".to_string()) .name("name".to_string()) .finalize(); let subcategory = ITunesCategoryBuilder::default() .text("text") .finalize(); let category = ITunesCategoryBuilder::default() .text("text") .subcategory(Box::new(subcategory)) .finalize(); let itunes_channel = ITunesChannelExtensionBuilder::default() .author("author".to_string()) .block("block".to_string()) .image("image".to_string()) .explicit("explicit".to_string()) .subtitle("subtitle".to_string()) .summary("summary".to_string()) .keywords("keywords".to_string()) .new_feed_url("new_feed_url".to_string()) .complete("complete".to_string()) .owner(owner) .categories(vec![category]) .finalize(); let builder = ChannelBuilder::default() .itunes_ext(itunes_channel);
fn dublin_core_ext<V>(self, dublin_core_ext: V) -> ChannelBuilder where
V: Into<Option<DublinCoreExtension>>,
V: Into<Option<DublinCoreExtension>>,
Set the DublinCoreExtension
for the Channel
.
fn extensions<V>(self, extensions: V) -> ChannelBuilder where
V: Into<ExtensionMap>,
V: Into<ExtensionMap>,
Set the extensions for the Channel
.
fn namespaces<V>(self, namespaces: V) -> ChannelBuilder where
V: Into<HashMap<String, String>>,
V: Into<HashMap<String, String>>,
Set the namespaces for the Channel
.
fn validate(self) -> Result<ChannelBuilder, Error>
Validate the contents of this ChannelBuilder
.
Examples
use rss::ChannelBuilder; let builder = ChannelBuilder::default() .title("The Linux Action Show! OGG") .link("http://www.jupiterbroadcasting.com") .description("Ogg Vorbis audio versions of The Linux Action Show!") .validate() .unwrap();
fn finalize(self) -> Channel
Construct the Channel
from this ChannelBuilder
.
Examples
use rss::ChannelBuilder; let channel = ChannelBuilder::default() .title("The Linux Action Show! OGG") .link("http://www.jupiterbroadcasting.com") .description("Ogg Vorbis audio versions of The Linux Action Show!") .finalize();
Trait Implementations
impl Debug for ChannelBuilder
[src]
impl Clone for ChannelBuilder
[src]
fn clone(&self) -> ChannelBuilder
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Default for ChannelBuilder
[src]
fn default() -> ChannelBuilder
Returns the "default value" for a type. Read more