feed_parser/lib.rs
1//! This module contains various parsers used in the feed-parser library.
2//!
3//! The parsers module provides functionality to parse different types of
4//! feed formats, such as RSS and Atom. Each parser is responsible for
5//! handling the specific details of its respective feed format, ensuring
6//! that the feed data is correctly interpreted and converted into a
7//! standardized format for further processing.
8//!
9//! # Quick Start
10//!
11//! ```
12//! use feed_parser::parsers::{Feed, rss2};
13//!
14//! let rss_data = r#"
15//! <rss version="2.0">
16//! <channel>
17//! <title>RSS Title</title>
18//! <link>http://www.example.com/main.html</link>
19//! <description>This is an example of an RSS feed</description>
20//! <item>
21//! <title>Item 1</title>
22//! <link>http://www.example.com/item1.html</link>
23//! <description>Item 1 description</description>
24//! <pubDate>2024-01-01T23:59:02Z</pubDate>
25//! </item>
26//! </channel>
27//! </rss>
28//! "#;
29//! let feeds: Vec<Feed> = rss2::parse(rss_data).unwrap();
30//! assert_eq!(feeds[0].title, "Item 1");
31//! assert_eq!(feeds[0].link, "http://www.example.com/item1.html");
32//! assert_eq!(feeds[0].description.clone().unwrap(), "Item 1 description");
33//! ```
34//!
35//! # Modules
36//!
37//! - `rss1`: Contains the RSS1.0 parser implementation.
38//! - `rss2`: Contains the RSS2.0 parser implementation.
39//! - `atom`: Contains the Atom parser implementation.
40//!
41//! # Errors
42//!
43//! Parsing errors are handled gracefully, with detailed error messages
44//! provided to help diagnose issues with the feed data.
45pub mod parsers;