Skip to main content

protocache_core/
lib.rs

1//! Core ProtoCache runtime primitives.
2//!
3//! The primary public surface keeps the original module layout:
4//! - `access`
5//! - `mutable`
6//! - `serialize`
7//! - `perfect_hash`
8//! - `utils`
9//!
10//! For Rust-first integration, prefer the re-exported helper modules:
11//! - `runtime`
12//! - `mutable`
13//! - `encoding`
14
15pub mod access;
16pub mod mutable;
17pub mod perfect_hash;
18pub mod serialize;
19pub mod utils;
20
21mod hash;
22
23pub mod runtime {
24    //! Rust-first aliases for the read-only runtime surface.
25    pub use crate::access::*;
26}
27
28pub mod encoding {
29    //! Rust-first aliases for encoding and buffer primitives.
30    pub use crate::serialize::*;
31    pub use crate::utils::{Buffer, Bytes, EnumValue, Scalar, Words};
32}
33
34pub use access::{
35    ArrayIter, ArrayView, BoolArray, FieldDecode, FieldView, MapIter, MapKey, MapView, MessageView,
36    PairView, ScalarArray, StringView, ViewArray, ViewMap, detect_array_with, detect_map_with,
37    detect_slice_end,
38};
39pub use mutable::{
40    MutableArray, MutableArrayElement, MutableError, MutableField, MutableMap, MutableMapKey,
41    MutableMapKeyKind, MutableMessage, copy_words,
42};
43pub use perfect_hash::PerfectHashView;
44pub use serialize::{
45    Segment, Unit, build_perfect_hash_index, build_perfect_hash_index_with_positions, fold_field,
46    serialize_array, serialize_array_at, serialize_array_at_mut, serialize_bool, serialize_bytes,
47    serialize_map, serialize_map_at, serialize_map_at_mut, serialize_message, serialize_message_at,
48    serialize_scalar, serialize_str,
49};
50pub use utils::{
51    Buffer, Bytes, CorruptionKind, EnumValue, ReadError, Scalar, Words, compress, compress_into,
52    decompress, decompress_into,
53};
54
55#[cfg(test)]
56mod tests;