Expand description
RSS Gen
A Rust library for generating, serializing, and deserializing RSS feeds for various RSS versions.
§Install
cargo add rss-genOr add to Cargo.toml:
[dependencies]
rss-gen = "0.0.5"You need Rust 1.79.0 or later. Works on macOS, Linux, and Windows.
§Overview
RSS Gen creates, serializes, and deserializes RSS feeds for multiple RSS versions.
- Feed generation with a builder API
- XML serialization to valid RSS output
- Deserialization of existing feeds into Rust structs
- Multi-version support — RSS 0.90 through 2.0
§Features
| RSS generation | Create RSS 2.0 feeds programmatically |
| Serialization | Serialize feeds to XML strings |
| Deserialization | Parse existing RSS feeds into Rust structs |
| Multiple versions | Support for RSS 0.90, 0.91, 0.92, 1.0, and 2.0 |
| Validation | Validate feed structure and required elements |
§Usage
use rss_gen::{generate_rss, RssData, RssVersion};
fn main() {
let rss = RssData::new(Some(RssVersion::RSS2_0))
.title("My Blog")
.link("https://example.com")
.description("A blog about Rust");
println!("{}", generate_rss(&rss).unwrap());
}§Development
cargo build # Build the project
cargo test # Run all tests
cargo clippy # Lint with Clippy
cargo fmt # Format with rustfmtSee CONTRIBUTING.md for setup, signed commits, and PR guidelines.
THE ARCHITECT \u1d2b Sebastien Rousseau THE ENGINE \u1d5e EUXIS \u1d2b Enterprise Unified Execution Intelligence System
§License
Dual-licensed under Apache 2.0 or MIT, at your option.
Re-exports§
pub use data::RssData;pub use data::RssItem;pub use data::RssVersion;pub use error::Result;pub use error::RssError;pub use generator::generate_rss;pub use parser::parse_rss;
Modules§
- data
- Contains the main types and data structures used to represent RSS feeds. This module contains the core data structures and functionality for RSS feeds.
- error
- Defines error types used throughout the library.
- generator
- Implements RSS feed generation functionality.
- macros
- Provides procedural macros for simplifying RSS operations. This module provides macros for generating RSS feeds and setting fields for RSS data.
- parser
- Implements RSS feed parsing functionality. A robust and flexible RSS feed parser.
- prelude
- Prelude module for convenient importing of common types and functions.
- validator
- Provides utilities for validating RSS feeds. RSS feed validator module
Macros§
- macro_
generate_ rss - Generates an RSS feed from the given
RssDatastruct. - macro_
get_ args macro_get_argsMacro- macro_
metadata_ option macro_metadata_optionMacro- macro_
set_ rss_ data_ fields - Sets fields of the
RssDatastruct. - macro_
write_ element - Writes an XML element with the given name and content.
Constants§
- MAX_
DESCRIPTION_ LENGTH - Maximum length for description fields in the RSS feed.
- MAX_
FEED_ SIZE - Maximum size for the entire RSS feed.
- MAX_
GENERAL_ LENGTH - Maximum length for general fields in the RSS feed.
- MAX_
LINK_ LENGTH - Maximum length for link fields in the RSS feed.
- MAX_
TITLE_ LENGTH - Maximum length for title fields in the RSS feed.
- VERSION
- The current version of the rss-gen crate, set at compile-time from Cargo.toml.
Functions§
- quick_
rss - A convenience function to generate a minimal valid RSS 2.0 feed.