Skip to main content

Crate crous_core

Crate crous_core 

Source
Expand description

§crous-core

Core encoder/decoder, block framing, Value type, and zero-copy types for the Crous binary format — a compact, canonical binary serializer and human-readable alternative to JSON.

§Quick Start

use crous_core::{Value, Encoder, Decoder};

let value = Value::Object(vec![
    ("name".into(), Value::Str("Alice".into())),
    ("age".into(), Value::UInt(30)),
]);

let mut encoder = Encoder::new();
encoder.encode_value(&value).unwrap();
let bytes = encoder.finish().unwrap();

let mut decoder = Decoder::new(&bytes);
let decoded = decoder.decode_next().unwrap();

Re-exports§

pub use block::BlockReader;
pub use block::BlockWriter;
pub use checksum::ChecksumAlgo;
pub use decoder::Decoder;
pub use encoder::Encoder;
pub use error::CrousError;
pub use error::Result;
pub use header::FLAGS_NONE;
pub use header::FileHeader;
pub use limits::Limits;
pub use traits::Crous;
pub use traits::CrousBytes;
pub use value::CrousValue;
pub use value::Value;

Modules§

block
Block-level framing for the Crous binary format.
checksum
Checksum utilities for Crous block integrity.
decoder
Decoder for the Crous binary format.
encoder
Encoder for the Crous binary format.
error
Error types for Crous encoding/decoding operations.
header
File header for the Crous binary format.
limits
Configurable resource limits for decoding, to prevent denial-of-service attacks.
text
Human-readable Crous text format: parser and pretty-printer.
traits
Trait for types that can be serialized/deserialized with the Crous format.
value
Value types for schema-less Crous data.
varint
Varint encoding: unsigned LEB128 and signed ZigZag + LEB128.
wire
Wire types for the Crous binary format.