Crate feedparser_rs

Crate feedparser_rs 

Source
Expand description

feedparser-rs-core: High-performance RSS/Atom/JSON Feed parser

This crate provides a pure Rust implementation of feed parsing with compatibility for Python’s feedparser library.

§Examples

use feedparser_rs::parse;

let xml = r#"
    <?xml version="1.0"?>
    <rss version="2.0">
        <channel>
            <title>Example Feed</title>
        </channel>
    </rss>
"#;

// Parsing will be fully implemented in Phase 2
let feed = parse(xml.as_bytes()).unwrap();
assert!(feed.bozo == false);

§Features

  • Parse RSS 0.9x, 1.0, 2.0
  • Parse Atom 0.3, 1.0
  • Parse JSON Feed 1.0, 1.1
  • Tolerant parsing with bozo flag
  • Multi-format date parsing
  • HTML sanitization
  • Encoding detection

§Architecture

The library provides core data structures like ParsedFeed, Entry, and FeedMeta for representing parsed feed data. The main entry point is the parse function which automatically detects feed format and returns parsed results.

Re-exports§

pub use types::Content;
pub use types::Enclosure;
pub use types::Entry;
pub use types::FeedMeta;
pub use types::FeedVersion;
pub use types::Generator;
pub use types::Image;
pub use types::ItunesCategory;
pub use types::ItunesEntryMeta;
pub use types::ItunesFeedMeta;
pub use types::ItunesOwner;
pub use types::LimitedCollectionExt;
pub use types::ParsedFeed;
pub use types::Person;
pub use types::PodcastFunding;
pub use types::PodcastMeta;
pub use types::PodcastPerson;
pub use types::PodcastTranscript;
pub use types::Source;
pub use types::Tag;
pub use types::TextConstruct;
pub use types::TextType;
pub use types::parse_duration;
pub use types::parse_explicit;
pub use namespace::syndication::SyndicationMeta;
pub use namespace::syndication::UpdatePeriod;
pub use http::FeedHttpClient;
pub use http::FeedHttpResponse;

Modules§

http
HTTP client module for fetching feeds from URLs
namespace
Namespace handlers for extended feed formats
types
Type definitions for feed data structures
util
Utility functions for feed parsing

Structs§

ParseOptions
Parser configuration options
ParserLimits
Parser limits for protecting against denial-of-service attacks

Enums§

FeedError
Feed parsing errors
LimitError
Errors that occur when parser limits are exceeded

Functions§

detect_format
Auto-detect feed format from raw data
parse
Parse feed from raw bytes
parse_url
Parse feed from HTTP/HTTPS URL
parse_url_with_limits
Parse feed from URL with custom parser limits
parse_with_limits
Parse feed with custom parser limits

Type Aliases§

Result
Result type for feed parsing operations