Crate atom_syndication [] [src]

Library for serializing the Atom web content syndication format

Examples

Writing

use atom_syndication::{Feed, Entry};

let entry = Entry {
    id: String::from("urn:uuid:4ae8550b-2987-49fa-9f8c-54c180c418ac"),
    title: String::from("Ford hires Elon Musk as CEO"),
    updated: String::from("2019-04-01T07:30:00Z"),
    ..Default::default()
};

let feed = Feed {
    id: String::from("urn:uuid:b3420f84-6bdf-4f46-a225-f1b9a14703b6"),
    title: String::from("TechCrunch"),
    updated: String::from("2019-04-01T07:30:00Z"),
    entries: vec![entry],
    ..Default::default()
};

let atom_string = feed.to_string();

Reading

use atom_syndication::Feed;

let atom_str = r#"
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <id>urn:uuid:b3420f84-6bdf-4f46-a225-f1b9a14703b6</id>
  <title>TechCrunch</title>
  <updated>2019-04-01T07:30:00Z</updated>
  <entry>
    <id>urn:uuid:4ae8550b-2987-49fa-9f8c-54c180c418ac</id>
    <title>Ford hires Elon Musk as CEO</title>
    <updated>2019-04-01T07:30:00Z</updated>
  </entry>
</feed>
"#;

let feed = atom_str.parse::<Feed>().unwrap();

Structs

Category

[The Atom Syndication Format § The "atom:category" Element] (https://tools.ietf.org/html/rfc4287#section-4.2.2)

Entry

[The Atom Syndication Format § The "atom:entry" Element] (https://tools.ietf.org/html/rfc4287#section-4.1.2)

Feed

[The Atom Syndication Format § The "atom:feed" Element] (https://tools.ietf.org/html/rfc4287#section-4.1.1)

Generator

[The Atom Syndication Format § The "atom:generator" Element] (https://tools.ietf.org/html/rfc4287#section-4.2.4)

Link

[The Atom Syndication Format § The "atom:link" Element] (https://tools.ietf.org/html/rfc4287#section-4.2.7)

Person

[The Atom Syndication Format § Person Constructs] (https://tools.ietf.org/html/rfc4287#section-3.2)

Source

[The Atom Syndication Format § The "atom:source" Element] (https://tools.ietf.org/html/rfc4287#section-4.2.11)

Enums

Content

[The Atom Syndication Format § The "atom:content" Element] (https://tools.ietf.org/html/rfc4287#section-4.1.3)

Error