[][src]Function bloguen::ops::feed_atom_header

pub fn feed_atom_header<W, E>(
    blog_name: &str,
    language: &LanguageTag,
    author: &str,
    link: Option<Cow<'static, str>>,
    into: &mut W,
    out_name_err: E
) -> Result<Cow<'static, str>, Error> where
    W: Write,
    E: Into<Cow<'static, str>>, 

Output the header for an Atom feed,

The link argument corresponds to the link tag, linking to the index page, and, if not present, will not be output.

Examples

let mut out = vec![];
let res = feed_atom_header(
    "Блогг", &LANGUAGE_EN_GB, "nabijaczleweli", Some("../index.html".into()),
    &mut out, "test blog");
assert_eq!(res, Ok("test blog".into()));

let out = str::from_utf8(&out).unwrap();
let gendate_local_rfc3339 = /* extracted from output's updated tag */;
assert_eq!(out, format!(r###"<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Блогг</title>
  <author>
    <name>nabijaczleweli</name>
  </author>
  <link href="../index.html" />
  <id>urn:uuid:4f568fb2-4417-5b80-85a8-651978a2da56</id>
  <generator href="//github.com/nabijaczleweli/bloguen" version="0.1.1">bloguen</generator>
  <updated>{}</updated>
"###, gendate_local_rfc3339));