Expand description
This crate provides an API to parse and create OPML documents.
§Parsing
To parse an OPML document use OPML::from_str or OPML::from_reader.
Parsing will result in an error if:
- the XML is malformed,
- the included OPML version is not supported (currently all OPML versions (1.0, 1.1 and 2.0) are supported) or,
- if the
Bodyelement contains no childOutlineelements, as per the spec.
use opml::OPML;
let xml = r#"<opml version="2.0"><head/><body><outline text="Outline"/></body></opml>"#;
let document = OPML::from_str(xml).unwrap();
assert_eq!(document.version, "2.0");§Creating
To create an OPML document from scratch, use OPML::default() or the good
old OPML { /* ... */ } syntax.
Structs§
- Body
- The
Bodychild element ofOPML. Contains all theOutlineelements. - Head
- The
Headchild element ofOPML. Contains the metadata of the OPML document. - OPML
- The top-level
OPMLelement. - Outline
- The
Outlineelement.
Enums§
- Error
- All possible errors.