Skip to main content

Crate libvctrl_core

Crate libvctrl_core 

Source
Expand description

§libvctrl_core – Reference Implementations

This crate provides concrete, minimal, and correct implementations for every trait defined in libvctrl_handler.

It is not intended to be the fastest or most featureful backend. Its purpose is to prove that the contracts can be fulfilled and to serve as a readable reference for anyone building their own version control primitives.

§Modules

  • validate – Reusable validation helpers (name, hash).
  • store – In‑memory object and reference stores.
  • hash – SHA‑512 hasher.
  • object – Builders for the four core object types.
  • codec – Binary encoder/decoder with a simple deterministic format.

§Usage

use libvctrl_core::store::MemoryStore;
use libvctrl_handler::{ObjectStore, Hash, HASH_LENGTH};

let mut store = MemoryStore::new();
let hash = Hash::from_bytes(&[0u8; HASH_LENGTH]).unwrap();
store.put(&hash, b"Hello").unwrap();
assert_eq!(store.get(&hash).unwrap(), b"Hello");

Modules§

codec
Binary serialization and deserialization for version control objects.
hash
Cryptographic hash function implementations. Cryptographic hash function implementations.
object
Builders for core object types (Blob, Tree, Commit, Tag). Builders for the four core object types.
store
In‑memory reference implementations of the storage traits. In‑memory reference implementations of the storage traits.
validate
Common validation utilities shared across modules. Common validation utilities shared across modules.