Skip to main content

Crate ucm_core

Crate ucm_core 

Source
Expand description

§UCM Core

Core types and traits for the Unified Content Model (UCM).

This crate provides the fundamental building blocks for representing structured content in a graph-based intermediate representation.

§Key Types

  • Block - The fundamental unit of content
  • BlockId - Content-addressed identifier with 96-bit collision resistance
  • Content - Typed content (text, table, code, etc.)
  • Document - A collection of blocks with hierarchical structure
  • Edge - Explicit relationships between blocks

§Example

use ucm_core::Content;
use ucm_core::id::generate_block_id;

let content = Content::text("Hello, UCP!");
let id = generate_block_id(&content, Some("intro.hook"), None);
println!("Block ID: {}", id);

Re-exports§

pub use block::Block;
pub use block::BlockState;
pub use content::BinaryEncoding;
pub use content::Cell;
pub use content::Code;
pub use content::Column;
pub use content::CompositeLayout;
pub use content::Content;
pub use content::DataType;
pub use content::Dimensions;
pub use content::JsonSchema;
pub use content::LineRange;
pub use content::Math;
pub use content::MathFormat;
pub use content::Media;
pub use content::MediaSource;
pub use content::MediaType;
pub use content::Row;
pub use content::Table;
pub use content::TableSchema;
pub use content::Text;
pub use content::TextFormat;
pub use document::Document;
pub use document::DocumentId;
pub use document::DocumentMetadata;
pub use edge::Edge;
pub use edge::EdgeIndex;
pub use edge::EdgeMetadata;
pub use edge::EdgeType;
pub use error::Error;
pub use error::ErrorCode;
pub use error::Result;
pub use error::ValidationIssue;
pub use error::ValidationSeverity;
pub use id::BlockId;
pub use id::ContentHash;
pub use id::IdGenerator;
pub use id::IdGeneratorConfig;
pub use metadata::BlockMetadata;
pub use metadata::RoleCategory;
pub use metadata::SemanticRole;
pub use metadata::TokenEstimate;
pub use metadata::TokenModel;
pub use version::DocumentVersion;
pub use version::Version;

Modules§

block
Block - the fundamental unit of content in UCM.
content
Content types for UCM blocks.
document
Document - a collection of blocks with hierarchical structure.
edge
Edge types and relationships between blocks.
error
Error types for UCM operations.
id
Block ID generation with 96-bit collision resistance.
metadata
Block metadata for search, display, and LLM optimization.
normalize
Content normalization for deterministic hashing.
version
Version tracking for optimistic concurrency control.