Skip to main content

qubit_codec_text/
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 Text Codec
9//!
10//! Low-level Unicode constants, character classification helpers, and text
11//! codec primitives for ASCII, ISO-8859-1, UTF-8, UTF-16, and UTF-32-oriented
12//! code.
13//!
14//! This crate deliberately stays below `std::io::Read` and `std::io::Write`.
15//! Concrete text I/O adapters are expected to own buffering, EOF handling, line
16//! endings, and `std::io::Error` mapping while using the codecs from this crate
17//! for strict buffer-level encoding and decoding.
18
19mod charset;
20mod codec;
21mod decode;
22mod encode;
23mod error;
24
25pub mod prelude;
26pub use charset::{
27    Ascii,
28    Charset,
29    Unicode,
30    UnicodeBom,
31    Utf8,
32    Utf16,
33    Utf32,
34};
35pub use codec::{
36    AsciiCodec,
37    CharsetCodec,
38    CharsetConvertError,
39    CharsetConverter,
40    Latin1Codec,
41    MalformedAction,
42    UnmappableAction,
43};
44pub use codec::{
45    Utf8Codec,
46    Utf16ByteCodec,
47    Utf16U16Codec,
48    Utf32ByteCodec,
49    Utf32U32Codec,
50};
51pub(crate) use decode::CharsetDecodeHooks;
52pub use decode::{
53    CharsetDecodePolicy,
54    CharsetDecoder,
55};
56pub(crate) use encode::CharsetEncodeHooks;
57pub use encode::{
58    CharsetEncodePolicy,
59    CharsetEncodeProbe,
60    CharsetEncoder,
61};
62pub use error::{
63    CharsetDecodeError,
64    CharsetDecodeErrorKind,
65    CharsetDecodeResult,
66    CharsetEncodeError,
67    CharsetEncodeErrorKind,
68    CharsetEncodeResult,
69};
70pub use qubit_codec::{
71    BufferedTranscoder,
72    ByteOrder,
73    CapacityError,
74    Codec,
75    TranscodeProgress,
76    TranscodeStatus,
77};