Expand description
Implements RSS feed parsing functionality. A robust and flexible RSS feed parser.
This module provides functionality to parse RSS feeds of various versions (0.90, 0.91, 0.92, 1.0, and 2.0) into a structured format. It offers comprehensive error handling, extensive customization options, and follows best practices in Rust development.
§Features
- Supports RSS versions 0.90, 0.91, 0.92, 1.0, and 2.0
- Robust error handling with custom error types
- Extensible parsing with custom element handlers
- Comprehensive test suite
- Thread-safe and memory-efficient implementation
§Examples
use rss_gen::parse_rss;
let xml_content = r#"
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>My Blog</title>
<link>https://example.com</link>
<description>A sample blog</description>
<item>
<title>First Post</title>
<link>https://example.com/first-post</link>
<description>This is my first post</description>
</item>
</channel>
</rss>
"#;
let parsed_data = parse_rss(xml_content, None).unwrap();
assert_eq!(parsed_data.title, "My Blog");
assert_eq!(parsed_data.items.len(), 1);
Re-exports§
pub use crate::data::RssData;
pub use crate::data::RssItem;
pub use crate::data::RssVersion;
pub use crate::error::Result;
pub use crate::error::RssError;
Structs§
- Configuration options for the RSS parser.
Traits§
- A trait for custom element handlers, supporting RSS extensions.
Functions§
- Parses an RSS feed from XML content.