[go: up one dir, main page]

Struct rss::ChannelBuilder [] [src]

pub struct ChannelBuilder { /* fields omitted */ }

A builder used to create a Channel.

Methods

impl ChannelBuilder
[src]

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.

Set the title of the Channel.

Examples

use rss::ChannelBuilder;

let builder = ChannelBuilder::default()
    .title("The Linux Action Show! OGG");

Set the web site URL for the Channel.

Examples

use rss::ChannelBuilder;

let builder = ChannelBuilder::default()
    .link("http://www.jupiterbroadcasting.com");

Set the description of the Channel.

Examples

use rss::ChannelBuilder;

let builder = ChannelBuilder::default()
    .description("Ogg Vorbis audio versions of The Linux Action Show!");

Set the language of the Channel.

Examples

use rss::ChannelBuilder;

let builder = ChannelBuilder::default()
    .language("en".to_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());

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

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

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

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

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

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

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

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

Set the time to live of the Channel.

Examples

use rss::ChannelBuilder;

let builder = ChannelBuilder::default()
    .ttl(60);

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

Set the PICS rating for the Channel.

Examples

use rss::ChannelBuilder;

let builder = ChannelBuilder::default()
    .rating("PG-13".to_string());

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

Set the hours that aggregators can skip for refreshing content.

Examples

use rss::ChannelBuilder;

let builder = ChannelBuilder::default()
    .skip_hours(vec![0, 12, 18]);

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

Set the Items 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]);

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

Set the DublinCoreExtension for the Channel.

Set the extensions for the Channel.

Set the namespaces for the Channel.

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

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]

Formats the value using the given formatter.

impl Clone for ChannelBuilder
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Default for ChannelBuilder
[src]

Returns the "default value" for a type. Read more