libvctrl_handler/lib.rs
1#![doc = include_str!("../README.md")]
2
3//! # `libvctrl_handler` – The Unshakeable Contract
4//!
5//! This crate **only** defines the fundamental traits, types, errors, and constants
6//! for building a version control system. **No implementations are allowed here.**
7//!
8//! It is the single source of truth for the entire `libvctrl` ecosystem.
9//! Every other component must depend on this crate and must never redefine
10//! these fundamental contracts.
11//!
12//! ## Philosophy
13//! - **Mechanism, not policy** – no assumptions about branches, workflows, or defaults.
14//! - **Unbounded flexibility, high discipline** – everything is generic and replaceable,
15//! but every input is strictly validated.
16//! - **This crate is the constitution** – all fundamental traits, types, and errors
17//! live exclusively here.
18//!
19//! ## Usage
20//! ```rust
21//! use libvctrl_handler::*;
22//!
23//! let hash = Hash::from_bytes(&[0u8; HASH_LENGTH]).unwrap();
24//! let entry = TreeEntry::new("file.txt".into(), EntryKind::Blob, hash).unwrap();
25//!
26//! let err = VctrlError::Other(format!("something went wrong: {}", 42));
27//! ```
28
29#![forbid(unsafe_code)]
30#![deny(missing_docs)]
31#![doc(html_root_url = "https://docs.rs/libvctrl_handler/1.0.0")]
32#![deny(rustdoc::broken_intra_doc_links)]
33
34pub mod constants;
35pub mod enums;
36pub mod errors;
37/// Convenience macros for working with errors.
38pub mod macros;
39pub mod traits;
40pub mod types;
41
42// Re-export fundamental items with explicit paths to avoid wildcard imports.
43pub use constants::{HASH_LENGTH, MAX_NAME_LENGTH};
44pub use enums::EntryKind;
45pub use errors::VctrlError;
46pub use traits::{Decoder, Encoder, Hasher, ObjectStore, RefStore, Signer, Transport, Verifier};
47pub use types::{Blob, Commit, Hash, Tag, Tree, TreeEntry, UserID};