Skip to main content

qubit_io_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 IO
9//!
10//! Synchronous and asynchronous text I/O traits and adapters for Rust.
11//!
12//! This crate defines small traits for code that produces or consumes Unicode
13//! text without choosing the final byte encoding or storage destination. It
14//! also provides adapters for in-memory text, UTF-8 byte streams, and
15//! byte-oriented [`qubit_codec_text`] charsets. [`AsyncCharsetTextReader`] and
16//! [`AsyncCharsetTextWriter`] drive the same charset state machines through
17//! runtime-neutral [`qubit_io::AsyncByteInput`] and
18//! [`qubit_io::AsyncByteOutput`].
19#![deny(missing_docs)]
20
21mod adapters;
22mod ext;
23mod io_error;
24mod line_ending;
25mod line_ending_set;
26pub mod prelude;
27mod stream;
28mod text_append_limit_error;
29mod text_reader_parts;
30mod traits;
31
32pub use adapters::AsyncCharsetTextReader;
33pub use adapters::AsyncCharsetTextWriter;
34pub use adapters::AsyncUtf8TextReader;
35pub use adapters::AsyncUtf8TextWriter;
36pub use adapters::CharsetStringDecoder;
37pub use adapters::CharsetStringEncoder;
38pub use adapters::CharsetTextReader;
39pub use adapters::CharsetTextWriter;
40pub use adapters::InputTextReader;
41pub use adapters::OutputTextWriter;
42pub use adapters::StrCharInput;
43pub use adapters::StrTextReader;
44pub use adapters::StringCharInput;
45pub use adapters::StringCharOutput;
46pub use adapters::StringTextReader;
47pub use adapters::StringTextWriter;
48pub use adapters::Utf8TextReader;
49pub use adapters::Utf8TextWriter;
50pub use ext::CharsetReadExt;
51pub use ext::CharsetWriteExt;
52pub use line_ending::LineEnding;
53pub use line_ending_set::LineEndingSet;
54pub use stream::BufferedTextReader;
55pub use stream::BufferedTextWriter;
56pub use text_append_limit_error::TextAppendLimitError;
57pub use text_reader_parts::TextReaderParts;
58pub use traits::AsyncTextLineReader;
59pub use traits::AsyncTextReader;
60pub use traits::AsyncTextWriter;
61pub use traits::TextLineReader;
62pub use traits::TextReader;
63pub use traits::TextWriter;