Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/steveklabnik/rust-atom
Library for serializing the Atom web content syndication format
https://github.com/steveklabnik/rust-atom
Last synced: 7 days ago
JSON representation
Library for serializing the Atom web content syndication format
- Host: GitHub
- URL: https://github.com/steveklabnik/rust-atom
- Owner: steveklabnik
- License: apache-2.0
- Created: 2015-10-28T21:39:08.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-28T21:39:31.000Z (about 9 years ago)
- Last Synced: 2024-12-10T22:26:24.418Z (13 days ago)
- Language: Rust
- Size: 806 KB
- Stars: 1
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rust-atom
[![atom_syndication on Crates.io](https://meritbadge.herokuapp.com/atom_syndication)](https://crates.io/crates/atom_syndication)
[Documentation](https://vtduncan.github.io/rust-atom/)
Library for serializing the Atom web content syndication format
## Examples
### Writing
```rust
use atom::{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
```rust
use atom::Feed;let atom_str = r#"
urn:uuid:b3420f84-6bdf-4f46-a225-f1b9a14703b6
TechCrunch
2019-04-01T07:30:00Z
urn:uuid:4ae8550b-2987-49fa-9f8c-54c180c418ac
Ford hires Elon Musk as CEO
2019-04-01T07:30:00Z
"#;
let feed = atom_str.parse::().unwrap();
```## Acknowledgements
Thanks to [Corey Farwell](https://rwell.org/) for writing
[rust-rss](https://github.com/frewsxcv/rust-rss). This library is a
fairly direct port of it to Atom.