rss_gen

Function quick_rss

source
pub fn quick_rss(title: &str, link: &str, description: &str) -> Result<String>
Expand description

A convenience function to generate a minimal valid RSS 2.0 feed.

This function creates an RSS 2.0 feed with the provided title, link, and description, and includes one example item.

§Arguments

  • title - The title of the RSS feed.
  • link - The link to the website associated with the RSS feed.
  • description - A brief description of the RSS feed.

§Returns

A Result containing the generated RSS feed as a String if successful, or an RssError if generation fails.

§Examples

use rss_gen::quick_rss;

let rss = quick_rss(
    "My Rust Blog",
    "https://myrustblog.com",
    "A blog about Rust programming"
);

match rss {
    Ok(feed) => println!("Generated RSS feed: {}", feed),
    Err(e) => eprintln!("Error: {}", e),
}