Skip to main content

qubit_codec/
lib.rs

1// =============================================================================
2//    Copyright (c) 2026 Haixing Hu.
3//
4//    SPDX-License-Identifier: Apache-2.0
5//
6//    Licensed under the Apache License, Version 2.0.
7// =============================================================================
8//! # qubit-codec
9//!
10//! Core codec traits and buffer conversion primitives for Rust applications.
11//!
12//! This crate contains only domain-neutral building blocks such as value
13//! codecs, owned value encoder/decoder helpers, byte-order markers, and
14//! progress-oriented buffer transcoders. The only I/O-facing types are the
15//! low-level `qubit_io::Input`/`qubit_io::Output` bridges used by downstream
16//! stream crates. Concrete binary, text, misc, and `std::io` adapters live in
17//! sibling crates.
18
19#![deny(missing_docs)]
20#![deny(unsafe_op_in_unsafe_fn)]
21
22mod byte_order;
23mod codec;
24mod transcode;
25mod value;
26
27pub use byte_order::{
28    BigEndian,
29    ByteOrder,
30    ByteOrderSpec,
31    LittleEndian,
32};
33pub use codec::{
34    Codec,
35    CodecConvertError,
36    CodecDecodeError,
37    CodecEncodeError,
38    DecodeFailure,
39};
40pub use transcode::{
41    CapacityError,
42    CodecTranscodeConverter,
43    CodecTranscodeDecoder,
44    CodecTranscodeEncoder,
45    DecodeContext,
46    DecodeInvalidAction,
47    EncodeContext,
48    EncodeOutcome,
49    TranscodeContractError,
50    TranscodeConvertEngine,
51    TranscodeConvertEngineError,
52    TranscodeConverter,
53    TranscodeDecodeEngine,
54    TranscodeDecodeEngineError,
55    TranscodeDecodeHooks,
56    TranscodeDecodeInput,
57    TranscodeDecoder,
58    TranscodeEncodeEngine,
59    TranscodeEncodeEngineError,
60    TranscodeEncodeHooks,
61    TranscodeEncodeOutput,
62    TranscodeEncoder,
63    TranscodeError,
64    TranscodeProgress,
65    TranscodeStatus,
66    Transcoder,
67};
68pub use value::{
69    CodecDecodeExactValueWithFlushResult,
70    CodecDecodeValueWithFlushResult,
71    CodecEncodeValueResult,
72    CodecValueDecoder,
73    CodecValueEncoder,
74    CodecValueExt,
75    ValueDecoder,
76    ValueEncoder,
77};