Skip to main content

Module parse

Module parse 

Source
Expand description

feed-rscrate::model conversion. Owner: parser agent.

Frozen public interface — crate::core depends on these exact signatures.

§Requirements

  • Parse body with feed_rs::parser::parse (auto-detects RSS/Atom/JSON Feed). Be lenient: malformed feeds should yield RssError::Parse, never a panic.
  • Normalize all dates to RFC-3339 UTC strings (feed-rs yields chrono::DateTime).
  • Resolve relative item links to absolute URLs against feed_url (use the url crate).
  • For each item, compute the stable id via crate::identity::item_id and the content via crate::content, honoring params.content_format.
  • Apply params.since (drop older items) and params.limit (keep newest N) — sort by published (fallback updated) descending before limiting.
  • Populate title, site_url (the feed’s <link>/homepage), and updated.

Structs§

ParsedFeed
Parsed feed metadata plus its items, ready to drop into a crate::model::FeedResult.

Functions§

parse_feed
Parse raw feed bytes into a ParsedFeed. feed_url is the (post-redirect) URL the bytes came from, used both for relative-link resolution and as the id namespace.