English | 日本語
feed-parser reads RSS 1.0, RSS 2.0 and Atom documents into a single Feed type, so
the code that consumes a feed does not need to know which format the source publishes.
Each format keeps its own parser, and the differences between them — dc:creator,
pubDate versus published, Atom's <link> attributes — are normalized on the way in.
Malformed input is returned as a ParseError rather than raised as a panic.
Install
Requires Rust 1.85 or newer.
Quick Start
use ;
let rss_data = r#"
<rss version="2.0">
<channel>
<title>RSS Title</title>
<link>http://www.example.com/main.html</link>
<description>This is an example of an RSS feed</description>
<item>
<title>Item 1</title>
<link>http://www.example.com/item1.html</link>
<description>Item 1 description</description>
<pubDate>2024-01-01T23:59:02Z</pubDate>
</item>
</channel>
</rss>
"#;
let feeds: = parse.unwrap;
assert_eq!;
assert_eq!;
assert_eq!;
Documentation
- Usage — the three parsers, the
Feedtype, and how each format's elements are mapped onto it. - Error Handling — every
ParseErrorvariant, when each is returned, and how to match on them. - Development — build and test commands, repository layout, the MSRV policy, and the release process.
- Changelog — release notes and the 1.x to 2.0 migration guide.
License
Licensed under the Apache License, Version 2.0. See LICENSE.