Crate feed [−] [src]
feed 3.0
This Library is for parsing through a channels field and creating a Feed
struct containing all elements of a Channel
based on the channels spec.
Usage
Put this in your Cargo.toml:
[dependencies]
feed = "3.0"
And put this in your crate root:
extern crate feed;
Examples
Reading Feeds
extern crate rss; extern crate feed; use feed::{FromUrl, ChannelGetters}; use rss::Channel; fn main() { let url = "https://feedpress.me/usererror.xml"; let channel = Channel::from_url(url).unwrap(); println!("Feed Title: {:?}", channel.title()); }
Writing Feeds
extern crate feed; use feed::ChannelBuilder; fn main() { 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 channel = ChannelBuilder::new() .title("The Linux Action Show! OGG") .link("http://www.jupiterbroadcasting.com") .description(description.as_ref()) .finalize().unwrap(); println!("Feed: {:?}", channel.to_string()); }
Validating Feeds
extern crate feed; use feed::ChannelBuilder; fn main() { 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 channel = ChannelBuilder::new() .title("The Linux Action Show! OGG") .link("http://www.jupiterbroadcasting.com") .description(description.as_ref()) .validate().unwrap() .finalize().unwrap(); println!("Feed: {:?}", channel.to_string()); }
extern crate rss; extern crate feed; use feed::{FromUrl, Validate}; use rss::Channel; fn main() { let url = "https://feedpress.me/usererror.xml"; let channel = Channel::from_url(url).unwrap(); channel.validate().unwrap(); }
Modules
channel |
All the structs for channels. |
extension |
All the extensions for |
Structs
CategoryBuilder |
This |
ChannelBuilder |
This |
CloudBuilder |
This |
EnclosureBuilder |
This |
GuidBuilder |
This |
ImageBuilder |
This |
ItemBuilder |
This |
SourceBuilder |
This |
TextInputBuilder |
This |
Traits
CategoryGetters |
The Getter functions for |
ChannelGetters |
The Getter functions for |
CloudGetters |
The Getter functions for |
EnclosureGetters |
The Getter functions for |
FromUrl |
From Url function for |
GuidGetters |
The Getter functions for |
ImageGetters |
The Getter functions for |
ItemGetters |
The Getter functions for |
SourceGetters |
The Getter functions for |
TextInputGetters |
The Getter functions for |
Validate |
Validate function for |