Skip to main content

Crate cdx_core

Crate cdx_core 

Source
Expand description

§cdx-core

Core library for reading, writing, and validating Codex Document Format (.cdx) files.

§Overview

Codex is an open document format designed for semantic content, verifiable integrity, and machine readability. This library provides the foundational capabilities for working with Codex documents in Rust.

§Quick Start

use cdx_core::{Document, DocumentState};

// Open an existing document
let doc = Document::open("example.cdx")?;
println!("State: {:?}", doc.state());

// Verify document integrity
doc.verify()?;

§Features

  • zstd (default): Zstandard compression support
  • wasm: WASM compilation support

Modules§

anchor
Unified anchor system for content references.
archive
Archive reading and writing for Codex documents.
asset
Asset management for embedded images, fonts, and files.
content
Content blocks and text representation.
extensions
Extension framework for Codex documents.
metadata
Metadata types for Codex documents.
presentation
Presentation layer types.
provenance
Provenance and integrity verification features.
securitysignatures
Digital signatures, encryption, and security features.
validation
JSON Schema validation for Codex Document Format files.

Structs§

AssetManifest
Asset manifest.
ContentRef
Reference to the content layer.
Document
A Codex document.
DocumentBuilder
Builder for creating Codex documents.
DocumentId
A content-addressable document identifier.
Extension
Extension declaration.
ExtensionValidationReport
Report from extension validation.
FileRef
Reference to a file within the archive.
Hasher
Streaming hasher for computing document and file hashes.
Lineage
Version history and document relationships.
Manifest
Document manifest - the root metadata structure.
Metadata
Metadata references.
PresentationRef
Reference to a presentation layer.
SecurityRef
Security layer reference.
VerificationReport
Report from document verification.

Enums§

DocumentState
Document lifecycle state.
Error
Errors that can occur when working with Codex documents.
HashAlgorithm
Hash algorithm identifier.

Constants§

FILE_EXTENSION
Default file extension for Codex documents.
MIME_TYPE
MIME type for Codex documents (JSON format).
SPEC_VERSION
Codex specification version implemented by this library.

Type Aliases§

Result
Result type alias using Error.