comicinfo (0.1.2)

Published 2025-11-30 21:43:52 +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.2

About this package

A rust crate to parse bare ComicInfo xml files.

comicinfo

A tiny Rust crate to parse ComicInfo.xml files.

Installation

Once available on crates.io, use cargo to add this to your project: cargo add comicinfo There are no feature flags.

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());

Please see the examples on the docs site for more details.

Dependencies

We depend on serde with the derive feature flag, and serde-xml-rs to make serde available for xml files. Internally we use indexset for collections on ComicInfo objects, and have a macro that requires paste to generate setters/getters and convenience methods. For property testing we need something that can generate random stuff, so we use rand.

Dependencies

ID Version
indexmap ^2.12.1
paste ^1.0.15
serde ^1.0.228
serde-xml-rs ^0.8.2
urlencoding ^2.1.3
rand ^0.9.2

Keywords

xml comicinfo comics manga
Details
Cargo
2025-11-30 21:43:52 +01:00
3
Daniel Barenholz <spam@dbarenholz.com>
MIT
40 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