Struct feed::ChannelBuilder [] [src]

pub struct ChannelBuilder { /* fields omitted */ }

This ChannelBuilder struct creates the Channel.

Methods

impl ChannelBuilder
[src]

Construct a new ChannelBuilder and return default values.

Examples

use feed::ChannelBuilder;

let channel_builder = ChannelBuilder::new();

Set the title that exists under Channel.

Examples

use feed::ChannelBuilder;

let mut channel_builder = ChannelBuilder::new();
channel_builder.title("The Linux Action Show! OGG");

Set the link that exists under Channel.

Examples

use feed::ChannelBuilder;

let mut channel_builder = ChannelBuilder::new();
channel_builder.link("http://www.jupiterbroadcasting.com");

Set the description that exists under Channel.

Examples

use feed::ChannelBuilder;

let description = "Ogg Vorbis audio versions of The Linux ".to_owned()
+ "Action Show! A show that covers everything geeks care about in the "
+ "computer industry. Get a solid dose of Linux, gadgets, news events "
+ "and much more!";

let mut channel_builder = ChannelBuilder::new();
channel_builder.description(description.as_ref());

Set the optional language that exists under Channel.

Examples

use feed::ChannelBuilder;

let mut channel_builder = ChannelBuilder::new();
channel_builder.language(Some("en".to_owned()));

Set the optional copyright that exists under Channel.

Examples

use feed::ChannelBuilder;

let copyright = "Copyright 2002, Spartanburg Herald-Journal".to_owned();

let mut channel_builder = ChannelBuilder::new();
channel_builder.copyright(Some(copyright));

Set the optional managing editor that exists under Channel.

Examples

use feed::ChannelBuilder;

let managing_editor =
    "chris@jupiterbroadcasting.com (Chris Fisher)".to_owned();

let mut channel_builder = ChannelBuilder::new();
channel_builder.managing_editor(Some(managing_editor));

Set the optional web master that exists under Channel.

Examples

use feed::ChannelBuilder;

let webmaster =
    "chris@jupiterbroadcasting.com (Chris Fisher)".to_owned();

let mut channel_builder = ChannelBuilder::new();
channel_builder.webmaster(Some(webmaster));

Set the optional pub date that exists under Channel.

Examples

use feed::ChannelBuilder;

let mut channel_builder = ChannelBuilder::new();
channel_builder.pub_date(Some("Sun, 13 Mar 2016 20:02:02
-0700".to_owned()));

Set the optional last build date that exists under Channel.

Examples

use feed::ChannelBuilder;

let mut channel_builder = ChannelBuilder::new();
channel_builder.last_build_date(Some("Sun, 13 Mar 2016 20:02:02
-0700".to_owned()));

Set the optional categories that exists under Channel.

Examples

use feed::{ChannelBuilder, CategoryBuilder};

let category = CategoryBuilder::new()
    .finalize()
    .unwrap();
let categories = vec![category];

let mut channel_builder = ChannelBuilder::new();
channel_builder.categories(categories);

Set the optional generator that exists under Channel.

Examples

use feed::ChannelBuilder;

let generator = "Feeder 2.5.12(2294); ".to_owned()
+ "Mac OS X Version 10.9.5 (Build 13F34) "
+ "http://reinventedsoftware.com/feeder/";

let mut channel_builder = ChannelBuilder::new();
channel_builder.generator(Some(generator));

Set the optional docs that exists under Channel.

Examples

use feed::ChannelBuilder;

let mut channel_builder = ChannelBuilder::new();
channel_builder.docs(Some("http://blogs.law.harvard.edu/tech/rss/".
to_owned()));

Set the optional cloud that exists under Channel.

Examples

use feed::{ChannelBuilder, CloudBuilder};

let cloud = CloudBuilder::new()
    .domain("http://rpc.sys.com/")
    .protocol("soap")
    .finalize()
    .unwrap();

let mut channel_builder = ChannelBuilder::new();
channel_builder.cloud(Some(cloud));

Set the optional ttl that exists under Channel.

Examples

use feed::ChannelBuilder;

let mut channel_builder = ChannelBuilder::new();
channel_builder.ttl(Some(60));

Set the optional image that exists under Channel.

Examples

use feed::{ChannelBuilder, ImageBuilder};

let url = "http://jupiterbroadcasting.com/images/LAS-300-Badge.jpg";

let link = "http://www.jupiterbroadcasting.com/";

let image = ImageBuilder::new()
    .url(url)
    .link(link)
    .finalize()
    .unwrap();

let mut channel_builder = ChannelBuilder::new();
channel_builder.image(Some(image));

Set the optional rating that exists under Channel.

Examples

use feed::ChannelBuilder;

let mut channel_builder = ChannelBuilder::new();
channel_builder.rating(Some("PG-13".to_owned()));

Set the optional text input that exists under Channel.

Examples

use feed::{ChannelBuilder, TextInputBuilder};

let text_input = TextInputBuilder::new()
    .link("http://www.example.com/feedback")
    .finalize()
    .unwrap();

let mut channel_builder = ChannelBuilder::new();
channel_builder.text_input(Some(text_input));

Set the optional skipdays that exists under Channel.

Examples

use feed::ChannelBuilder;

let hours: Vec<i64> = vec![0, 12, 18];

let mut channel_builder = ChannelBuilder::new();
channel_builder.skip_hours(hours);

Set the optional skipdays that exists under Channel.

Examples

use feed::ChannelBuilder;

let days = vec!["Monday".to_owned(), "Tuesday".to_owned()];

let mut channel_builder = ChannelBuilder::new();
channel_builder.skip_days(days);

Set the optional items that exists under Channel.

Examples

use feed::{ChannelBuilder, ItemBuilder};

let title = "Making Music with Linux | LAS 408".to_owned();

let item = ItemBuilder::new()
    .title(Some(title))
    .finalize()
    .unwrap();
let items = vec![item];

let mut channel_builder = ChannelBuilder::new();
channel_builder.items(items);

Set the optional itunes channel extension that exists under Channel.

Examples

use feed::ChannelBuilder;
use feed::extension::itunes::{ITunesChannelExtensionBuilder,
ITunesOwnerBuilder, ITunesCategoryBuilder};

let owner = ITunesOwnerBuilder::new()
    .email(Some("email@example.com".to_owned()))
    .name(Some("name".to_owned()))
    .finalize()
    .unwrap();

let subcategory = ITunesCategoryBuilder::new()
    .text("text")
    .finalize()
    .unwrap();

let category = ITunesCategoryBuilder::new()
    .text("text")
    .subcategory(Some(Box::new(subcategory)))
    .finalize()
    .unwrap();

let categories = vec![category];

let itunes_channel = ITunesChannelExtensionBuilder::new()
    .author(Some("author".to_owned()))
    .block(Some("block".to_owned()))
    .image(Some("image".to_owned()))
    .explicit(Some("explicit".to_owned()))
    .subtitle(Some("subtitle".to_owned()))
    .summary(Some("summary".to_owned()))
    .keywords(Some("keywords".to_owned()))
    .new_feed_url(Some("new_feed_url".to_owned()))
    .complete(Some("complete".to_owned()))
    .owner(Some(owner))
    .categories(categories)
    .finalize()
    .unwrap();

let mut channel_builder = ChannelBuilder::new();
channel_builder.itunes_ext(Some(itunes_channel));

Validate the contents of Channel.

Examples

use feed::ChannelBuilder;

let description = "Ogg Vorbis audio versions of The Linux ".to_owned()
+ "Action Show! A show that covers everything geeks care about in the "
+ "computer industry. Get a solid dose of Linux, gadgets, news events "
+ "and much more!";

let channels = ChannelBuilder::new()
        .title("The Linux Action Show! OGG")
        .link("http://www.jupiterbroadcasting.com")
        .description(description.as_ref())
        .language(None)
        .copyright(None)
        .managing_editor(None)
        .webmaster(None)
        .pub_date(None)
        .last_build_date(None)
        .categories(Vec::new())
        .generator(None)
        .docs(None)
        .cloud(None)
        .ttl(None)
        .image(None)
        .rating(None)
        .text_input(None)
        .skip_hours(Vec::new())
        .skip_days(Vec::new())
        .items(Vec::new())
        .validate().unwrap()
        .finalize().unwrap();

Construct the Channel from the ChannelBuilder.

Examples

use feed::ChannelBuilder;

let description = "Ogg Vorbis audio versions of The Linux ".to_owned()
+ "Action Show! A show that covers everything geeks care about in the "
+ "computer industry. Get a solid dose of Linux, gadgets, news events "
+ "and much more!";

let channels = ChannelBuilder::new()
        .title("The Linux Action Show! OGG")
        .link("http://www.jupiterbroadcasting.com")
        .description(description.as_ref())
        .language(None)
        .copyright(None)
        .managing_editor(None)
        .webmaster(None)
        .pub_date(None)
        .last_build_date(None)
        .categories(Vec::new())
        .generator(None)
        .docs(None)
        .cloud(None)
        .ttl(None)
        .image(None)
        .rating(None)
        .text_input(None)
        .skip_hours(Vec::new())
        .skip_days(Vec::new())
        .items(Vec::new())
        .finalize();

Trait Implementations

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