Skip to main content

crous_core/
lib.rs

1//! # crous-core
2//!
3//! Core encoder/decoder, block framing, `Value` type, and zero-copy types
4//! for the Crous binary format — a compact, canonical binary serializer
5//! and human-readable alternative to JSON.
6//!
7//! ## Quick Start
8//!
9//! ```rust
10//! use crous_core::{Value, Encoder, Decoder};
11//!
12//! let value = Value::Object(vec![
13//!     ("name".into(), Value::Str("Alice".into())),
14//!     ("age".into(), Value::UInt(30)),
15//! ]);
16//!
17//! let mut encoder = Encoder::new();
18//! encoder.encode_value(&value).unwrap();
19//! let bytes = encoder.finish().unwrap();
20//!
21//! let mut decoder = Decoder::new(&bytes);
22//! let decoded = decoder.decode_next().unwrap();
23//! ```
24
25pub mod block;
26pub mod checksum;
27pub mod decoder;
28pub mod encoder;
29pub mod error;
30pub mod header;
31pub mod limits;
32pub mod text;
33pub mod traits;
34pub mod value;
35pub mod varint;
36pub mod wire;
37
38pub use block::{BlockReader, BlockWriter};
39pub use checksum::ChecksumAlgo;
40#[cfg(feature = "fast-alloc")]
41pub use decoder::BumpDecoder;
42pub use decoder::Decoder;
43pub use encoder::Encoder;
44pub use error::{CrousError, Result};
45pub use header::{FLAGS_NONE, FileHeader};
46pub use limits::Limits;
47pub use traits::Crous;
48pub use traits::CrousBytes;
49pub use value::{CrousValue, Value};