Crate rss [] [src]

Library for serializing the RSS web content syndication format.

Reading

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

Example

use std::fs::File;
use std::io::BufReader;
use rss::Channel;

let file = File::open("example.xml").unwrap();
let reader = BufReader::new(file);
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.

Example

use std::fs::File;
use std::io::{BufReader, sink};
use rss::Channel;

let file = File::open("example.xml").unwrap();
let reader = BufReader::new(file);
let channel = Channel::read_from(reader).unwrap();

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

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

Reexports

pub use extension::Extension;

Modules

extension

Types and functions for namespaced extensions.

Structs

Category

A representation of the <category> element.

CategoryBuilder

This CategoryBuilder struct creates the Category.

Channel

A representation of the <channel> element.

ChannelBuilder

This ChannelBuilder struct creates the Channel.

Cloud

A representation of the <cloud> element.

CloudBuilder

This CloudBuilder struct creates the Cloud.

Enclosure

A representation of the <enclosure> element.

EnclosureBuilder

This EnclosureBuilder struct creates the Enclosure.

Guid

A representation of the <guid> element.

GuidBuilder

This GuidBuilder struct creates the Guid.

Image

A representation of the <image> element.

ImageBuilder

This ImageBuilder struct creates the Image.

Item

A representation of the <item> element.

ItemBuilder

This ItemBuilder struct creates the Item.

Source

A representation of the <source> element.

SourceBuilder

This SourceBuilder struct creates the Source.

TextInput

A representation of the <textInput> element.

TextInputBuilder

This TextInputBuilder struct creates the TextInput.

Enums

Error

Types of errors that could occur while parsing an RSS feed.