Expand description
§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§
Structs§
- Category
Builder - This
CategoryBuilderstruct creates theCategory. - Channel
Builder - This
ChannelBuilderstruct creates theChannel. - Cloud
Builder - This
CloudBuilderstruct creates theCloud. - Enclosure
Builder - This
EnclosureBuilderstruct creates theEnclosure. - Guid
Builder - This
GuidBuilderstruct creates theGuid. - Image
Builder - This
ImageBuilderstruct creates theImage. - Item
Builder - This
ItemBuilderstruct creates theItem. - Source
Builder - This
SourceBuilderstruct creates theSource. - Text
Input Builder - This
TextInputBuilderstruct creates theTextInput.
Traits§
- Category
Getters - The Getter functions for
Category - Channel
Getters - The Getter functions for
Channel - Cloud
Getters - The Getter functions for
Cloud - Enclosure
Getters - The Getter functions for
Enclosure - FromUrl
- From Url function for
Channel - Guid
Getters - The Getter functions for
Guid - Image
Getters - The Getter functions for
Image - Item
Getters - The Getter functions for
Item - Source
Getters - The Getter functions for
Source - Text
Input Getters - The Getter functions for
TextInput - Validate
- Validate function for
Channel