rss 0.5.0

Library for serializing the RSS web content syndication format
Documentation

rss

Build Status Crates.io Status

Library for serializing the RSS web content syndication format.

This library provides a complete implementation of the RSS 2.0 specification.

Documentation

Usage

Add the dependency to your Cargo.toml.

[dependencies]
rss = "0.4"

The package includes a single crate named rss.

extern crate rss;

Reading

A channel can be read from any object that implements the BufRead trait.

let reader: BufRead = ...;
let channel = Channel::read_from(reader).unwrap();

Writing

A channel can be written to any object that implements the Write trait or converted to an XML string using the ToString trait.

Note: Writing a channel does not perform any escaping of XML entities.

let channel: Channel = ...;
let writer: Write = ...;

// write the channel to a writer
channel.write_to(writer).unwrap();

// convert the channel to a string
let string = channel.to_string();

Extensions

Elements which have non-default namespaces will be considered extensions. Extensions are stored in Channel.extensions and Item.extensions.

For conveninence, Dublin Core and iTunes extensions are extracted to structs and stored in Channel.itunes_ext, Channel.dublin_core_ext, Item.itunes_ext, and Item.dublin_core_ext.

Invalid Feeds

As a best effort to parse invalid feeds rss will default elements declared as "required" by the RSS 2.0 specification to an empty string.

License

Licensed under either of

at your option.