comicinfo (0.1.0)
Installation
[registry]
default = "forgejo"
[registries.forgejo]
index = "sparse+ " # Sparse index
# index = " " # Git
[net]
git-fetch-with-cli = truecargo add comicinfo@0.1.0About this package
comicinfo
A tiny Rust crate to parse ComicInfo.xml files.
Installation
Once available on crates.io, use cargo to add this to your project.
There are no feature flags.
cargo add comicinfo
Usage
The default version for the comicinfo spec is 2.1 (Draft), which is probably what you want.
use comicinfo::ComicInfo; // refers to the default version
let xml = std::fs::read_to_string("ComicInfo.xml")?;
let comicinfo = ComicInfo::from_str(&xml)?;
println!("Series: {}", info.series.unwrap_or_default());
Otherwise, import a specific version of the spec
use comicinfo::v2_0::ComicInfo; // explicitly use version 2.0
let xml = std::fs::read_to_string("ComicInfo.xml")?;
let comicinfo = ComicInfo::from_str(&xml)?;
println!("Series: {}", info.series.unwrap_or_default());
Dependencies
We depend on serde with the derive feature flag, and serde-xml-rs to make serde available for xml files.
Warning
⚠️ There is a known issue in
serde-xml-rsfor XML attributes with a colon in their name. As such, we don't cannot parse axmlns:xsdURL. Once upstream (and its upstream) projects fix this issue,comicinfowill pass its roundtrip tests succesfully.
Dependencies
| ID | Version |
|---|---|
| serde | ^1.0.228 |
| serde-xml-rs | ^0.8.2 |
Details
Assets (1)
Versions (3)
View all
comicinfo-0.1.0.crate
9.6 KiB