Skip to main content

ucm_core/
lib.rs

1//! # UCM Core
2//!
3//! Core types and traits for the Unified Content Model (UCM).
4//!
5//! This crate provides the fundamental building blocks for representing
6//! structured content in a graph-based intermediate representation.
7//!
8//! ## Key Types
9//!
10//! - [`Block`] - The fundamental unit of content
11//! - [`BlockId`] - Content-addressed identifier with 96-bit collision resistance
12//! - [`Content`] - Typed content (text, table, code, etc.)
13//! - [`Document`] - A collection of blocks with hierarchical structure
14//! - [`Edge`] - Explicit relationships between blocks
15//!
16//! ## Example
17//!
18//! ```rust
19//! use ucm_core::Content;
20//! use ucm_core::id::generate_block_id;
21//!
22//! let content = Content::text("Hello, UCP!");
23//! let id = generate_block_id(&content, Some("intro.hook"), None);
24//! println!("Block ID: {}", id);
25//! ```
26
27pub mod block;
28pub mod content;
29pub mod document;
30pub mod edge;
31pub mod error;
32pub mod id;
33pub mod metadata;
34pub mod normalize;
35pub mod version;
36
37pub use block::{Block, BlockState};
38pub use content::{
39    BinaryEncoding, Cell, Code, Column, CompositeLayout, Content, DataType, Dimensions, JsonSchema,
40    LineRange, Math, MathFormat, Media, MediaSource, MediaType, Row, Table, TableSchema, Text,
41    TextFormat,
42};
43pub use document::{Document, DocumentId, DocumentMetadata};
44pub use edge::{Edge, EdgeIndex, EdgeMetadata, EdgeType};
45pub use error::{Error, ErrorCode, Result, ValidationIssue, ValidationSeverity};
46pub use id::{BlockId, ContentHash, IdGenerator, IdGeneratorConfig};
47pub use metadata::{BlockMetadata, RoleCategory, SemanticRole, TokenEstimate, TokenModel};
48pub use version::{DocumentVersion, Version};