Skip to main content

Crate rss_gen

Crate rss_gen 

Source
Expand description

RSS Gen logo

RSS Gen

A Rust library for generating, serializing, and deserializing RSS feeds for various RSS versions.

Build Crates.io Docs.rs Coverage lib.rs


§Install

cargo add rss-gen

Or 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 generationCreate RSS 2.0 feeds programmatically
SerializationSerialize feeds to XML strings
DeserializationParse existing RSS feeds into Rust structs
Multiple versionsSupport for RSS 0.90, 0.91, 0.92, 1.0, and 2.0
ValidationValidate 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 rustfmt

See 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.

Back to Top

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 RssData struct.
macro_get_args
macro_get_args Macro
macro_metadata_option
macro_metadata_option Macro
macro_set_rss_data_fields
Sets fields of the RssData struct.
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.