claw_core/lib.rs
1//! Core Claw VCS object types, IDs, hashing, and COF encoding.
2//!
3//! `claw-core` owns the stable in-repository data model: typed objects,
4//! content-addressed IDs, Protocol Buffer conversions, and Claw Object Format
5//! helpers. Higher-level crates should use these APIs instead of duplicating
6//! serialization or hashing behavior.
7//!
8//! # Example
9//!
10//! ```rust
11//! use claw_core::hash::content_hash;
12//! use claw_core::object::TypeTag;
13//!
14//! let id = content_hash(TypeTag::Blob, b"hello");
15//! assert_eq!(id.as_bytes().len(), 32);
16//! ```
17//!
18#![deny(missing_docs)]
19
20/// Claw Object Format encoding and decoding.
21pub mod cof;
22/// Core error types shared across object encoding and conversion.
23pub mod error;
24/// Prost-generated Protocol Buffer bindings.
25pub mod generated;
26/// Domain-separated content hashing helpers.
27pub mod hash;
28/// Strongly typed object, intent, change, and conflict identifiers.
29pub mod id;
30/// Top-level repository object enum and type tags.
31pub mod object;
32/// Deterministic conversions between core objects and generated protobuf types.
33pub mod proto_conv;
34/// Hand-written Claw VCS object model types.
35pub mod types;
36
37pub use error::CoreError;
38pub use hash::content_hash;
39pub use id::{ChangeId, IntentId, ObjectId};
40pub use object::Object;