Crate atom_syndication

Source
Expand description

Library for serializing the Atom web content syndication format.

§Reading

A feed can be read from any object that implements the BufRead trait or using the FromStr trait.

use std::fs::File;
use std::io::BufReader;
use atom_syndication::Feed;

let file = File::open("example.xml").unwrap();
let feed = Feed::read_from(BufReader::new(file)).unwrap();

let string = "<feed></feed>";
let feed = string.parse::<Feed>().unwrap();

§Writing

A feed can be written to any object that implements the Write trait or converted to an XML string using the ToString trait.

§Example

use std::fs::File;
use std::io::{BufReader, sink};
use atom_syndication::Feed;

let file = File::open("example.xml").unwrap();
let feed = Feed::read_from(BufReader::new(file)).unwrap();

// write to the feed to a writer
feed.write_to(sink()).unwrap();

// convert the feed to a string
let string = feed.to_string();

Modules§

extension
Types and functions for namespaced extensions.

Structs§

Category
Represents a category in an Atom feed
CategoryBuilder
Builder for Category.
Content
Represents the content of an Atom entry
ContentBuilder
Builder for Content.
Entry
Represents an entry in an Atom feed
EntryBuilder
Builder for Entry.
Feed
Represents an Atom feed
FeedBuilder
Builder for Feed.
Generator
Represents the generator of an Atom feed
GeneratorBuilder
Builder for Generator.
Link
Represents a link in an Atom feed
LinkBuilder
Builder for Link.
Person
Represents a person in an Atom feed
PersonBuilder
Builder for Person.
Source
Represents the source of an Atom entry
SourceBuilder
Builder for Source.
Text
Represents a text construct in an Atom feed.
TextBuilder
Builder for Text.
WriteConfig
Various options which control XML writer

Enums§

Error
An error that occurred while performing an Atom operation.
TextType
Represents the value of the type attribute of a text construct in an Atom feed, e.g. the type of the content stored in the element.

Type Aliases§

FixedDateTime
Alias of ::chrono::DateTime<::chrono::FixedOffset>