Expand description
Archive reading and writing for Codex documents.
Codex documents are packaged as ZIP archives with the .cdx extension.
This module provides CdxReader and CdxWriter for working with these archives.
§Reading Documents
ⓘ
use cdx_core::archive::CdxReader;
let mut reader = CdxReader::open("document.cdx")?;
let manifest = reader.manifest();
let content = reader.read_file("content/document.json")?;§Writing Documents
ⓘ
use cdx_core::archive::CdxWriter;
let mut writer = CdxWriter::create("output.cdx")?;
writer.write_manifest(&manifest)?;
writer.write_file("content/document.json", &content)?;
writer.finish()?;Structs§
- CdxReader
- Reader for Codex document archives.
- CdxWriter
- Writer for creating Codex document archives.
- Memory
Storage - In-memory storage for testing purposes.
Enums§
- Compression
Method - Compression method for files in the archive.
Constants§
- ACADEMIC_
NUMBERING_ PATH - Path to the academic numbering configuration file within the archive.
- BIBLIOGRAPHY_
PATH - Path to the bibliography file within the archive.
- COMMENTS_
PATH - Path to the collaboration comments file within the archive.
- CONTENT_
PATH - Path to the content file within the archive.
- DUBLIN_
CORE_ PATH - Path to the Dublin Core metadata file within the archive.
- ENCRYPTION_
PATH - Path to the encryption metadata file within the archive.
- FORMS_
DATA_ PATH - Path to the form data file within the archive.
- JSONLD_
PATH - Path to the JSON-LD metadata file within the archive.
- MANIFEST_
PATH - Path to the manifest file within the archive.
- PHANTOMS_
PATH - Path to the phantom clusters file within the archive.
- SIGNATURES_
PATH - Path to the signatures file within the archive.
- ZIP_
COMMENT - ZIP comment for Codex documents.
Traits§
- Archive
Storage - Trait for archive storage backends.
Functions§
- is_
url_ safe_ path - Check whether an asset path contains only URL-safe characters.