comicinfo (0.1.0)

Published 2025-11-18 18:14:38 +01:00 by dan in dan/comicinfo

Installation

[registry]
default = "forgejo"

[registries.forgejo]
index = "sparse+" # Sparse index
# index = "" # Git

[net]
git-fetch-with-cli = true
cargo add comicinfo@0.1.0

About 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-rs for XML attributes with a colon in their name. As such, we don't cannot parse a xmlns:xsd URL. Once upstream (and its upstream) projects fix this issue, comicinfo will pass its roundtrip tests succesfully.

Dependencies

ID Version
serde ^1.0.228
serde-xml-rs ^0.8.2
Details
Cargo
2025-11-18 18:14:38 +01:00
1
9.6 KiB
Assets (1)
Versions (3) View all
0.1.2 2025-11-30
0.1.1 2025-11-19
0.1.0 2025-11-18