pub struct Feed {
pub title: String,
pub site_url: String,
pub feed_url: String,
pub description: Option<String>,
pub language: Option<String>,
pub updated: Option<String>,
pub icon: Option<String>,
pub author: Option<String>,
pub entries: Vec<FeedEntry>,
}Expand description
A syndication feed, rendered as RSS 2.0, Atom 1.0 or JSON Feed 1.1.
Serve it from an API route, one URL per format:
ⓘ
// app/feed.xml/route.rs
pub async fn GET() -> Response {
Response::xml(feed().to_rss())
}Dates are YYYY-MM-DD or full RFC 3339 (2026-09-18T09:30:00Z); each
format receives the shape it requires.
Fields§
§title: String§site_url: StringThe site the feed belongs to, e.g. https://example.com.
feed_url: StringThis feed’s own URL, e.g. https://example.com/feed.xml.
description: Option<String>§language: Option<String>§updated: Option<String>When the feed last changed. Defaults to the newest entry’s date.
icon: Option<String>§entries: Vec<FeedEntry>Implementations§
Source§impl Feed
impl Feed
pub fn new( title: impl Into<String>, site_url: impl Into<String>, feed_url: impl Into<String>, ) -> Feed
pub fn description(self, text: impl Into<String>) -> Feed
pub fn language(self, lang: impl Into<String>) -> Feed
pub fn updated(self, date: impl Into<String>) -> Feed
pub fn icon(self, url: impl Into<String>) -> Feed
pub fn entry(self, entry: FeedEntry) -> Feed
pub fn entries(self, entries: impl IntoIterator<Item = FeedEntry>) -> Feed
Trait Implementations§
Auto Trait Implementations§
impl Forget for Feed
impl Freeze for Feed
impl Move for Feed
impl RefUnwindSafe for Feed
impl Send for Feed
impl Sync for Feed
impl Unpin for Feed
impl UnsafeUnpin for Feed
impl UnwindSafe for Feed
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more