Skip to main content

qubit_io/
lib.rs

1/*******************************************************************************
2 *
3 *    Copyright (c) 2026 Haixing Hu.
4 *
5 *    SPDX-License-Identifier: Apache-2.0
6 *
7 *    Licensed under the Apache License, Version 2.0.
8 *
9 ******************************************************************************/
10
11//! # Qubit IO
12//!
13//! Small I/O trait utilities for Rust.
14//!
15//! This crate provides named, object-safe composition traits for common
16//! [`std::io`] capability combinations and small extension traits for recurring
17//! standard-library I/O patterns. The concrete trait definitions live in
18//! dedicated modules and are re-exported from the crate root for ergonomic use.
19
20mod codec;
21mod coder;
22mod ext;
23pub mod prelude;
24mod stream;
25mod traits;
26mod util;
27mod wrappers;
28
29pub use codec::{
30    BigEndian,
31    BinaryCodec,
32    ByteOrder,
33    ByteOrderSpec,
34    DecodePolicy,
35    Leb128Codec,
36    Leb128DecodeError,
37    Leb128DecodeErrorKind,
38    LittleEndian,
39    NonStrict,
40    Strict,
41    ZigZagCodec,
42};
43pub use coder::{
44    Coder,
45    CoderProgress,
46    CoderStatus,
47};
48pub use ext::{
49    BinaryReadExt,
50    BinaryWriteExt,
51    BufReadExt,
52    Leb128ReadExt,
53    Leb128WriteExt,
54    ReadExt,
55    ReadSeekExt,
56    SeekExt,
57    StringReadExt,
58    StringWriteExt,
59    WriteExt,
60    WriteSeekExt,
61    ZigZagReadExt,
62    ZigZagWriteExt,
63};
64pub use stream::{
65    BinaryReader,
66    BinaryWriter,
67    BufferedBinaryReader,
68    BufferedBinaryWriter,
69    BufferedLeb128Reader,
70    BufferedLeb128Writer,
71    BufferedZigZagReader,
72    BufferedZigZagWriter,
73    Leb128Reader,
74    Leb128Writer,
75    ZigZagReader,
76    ZigZagWriter,
77};
78pub use traits::{
79    BufReadSeek,
80    ReadSeek,
81    ReadWrite,
82    ReadWriteSeek,
83    WriteSeek,
84};
85pub use util::Streams;
86pub use wrappers::{
87    ChecksumReader,
88    ChecksumWriter,
89    CountingReader,
90    CountingWriter,
91    LimitReader,
92    LimitWriter,
93    PositionGuard,
94    TeeReader,
95    TeeWriter,
96};