[−][src]Function bloguen::ops::feed_rss_post_header
pub fn feed_rss_post_header<W, E, Tz>(
post_name: &str,
post_id_name: &str,
language: &LanguageTag,
author: &str,
base: &str,
link: &str,
post_date: &DateTime<Tz>,
into: &mut W,
out_name_err: E
) -> Result<Cow<'static, str>, Error> where
Tz: TimeZone,
W: Write,
E: Into<Cow<'static, str>>,
Output the post header for an RSS feed,
The post_id_name
argment is used as the entry GUID,
the base
argument is unused,
the link
argument points to the corresponding post HTML.
Examples
let mut out = vec![]; let res = feed_rss_post_header( "release-front - a generic release front-end, like Patchwork's", "003. 2018-02-05 release-front - a generic release front-end, like Patchwork's", &LANGUAGE_EN_GB, "nabijaczleweli", "../posts/", "../posts/003. 2018-02-05 release-front - a generic release front-end, like Patchwork's.html", &DateTime::parse_from_rfc3339("2018-09-06T18:32:22+02:00").unwrap(), &mut out, "test post"); assert_eq!(res, Ok("test post".into())); let out = str::from_utf8(&out).unwrap(); assert_eq!(out, r###" <item> <title>release-front - a generic release front-end, like Patchwork's</title> <author>nabijaczleweli</author> <link>../posts/003. 2018-02-05 release-front - a generic release front-end, like Patchwork's.html</link> <pubDate>Thu, 6 Sep 2018 18:32:22 +0200</pubDate> <guid>003. 2018-02-05 release-front - a generic release front-end, like Patchwork's</guid> <description> "###);