qubit_io/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
9//! # Qubit IO
10//!
11//! Byte-stream buffering and small I/O trait utilities for Rust.
12//!
13//! This crate provides named, object-safe composition traits for common
14//! [`std::io`] capability combinations and small extension traits for recurring
15//! standard-library I/O patterns.
16//!
17//! It also provides byte-oriented buffering primitives in [`buffered`]:
18//! [`Buffer`], [`BufferedInput`], and [`BufferedOutput`]. These types
19//! are intentionally format-agnostic. Binary and text stream adapters live in
20//! sibling crates and build their codec-specific behavior on top of these byte
21//! windows.
22//!
23//! The concrete trait definitions and wrapper types live in dedicated modules
24//! and are re-exported from the crate root for ergonomic use.
25
26pub mod buffered;
27mod ext;
28pub mod prelude;
29mod traits;
30mod util;
31mod wrappers;
32
33pub use buffered::{
34 Buffer,
35 BufferedInput,
36 BufferedOutput,
37 DEFAULT_BUFFER_CAPACITY,
38};
39pub use ext::{
40 BufReadExt,
41 ReadExt,
42 ReadSeekExt,
43 SeekExt,
44 WriteExt,
45 WriteSeekExt,
46};
47pub use traits::{
48 BufReadSeek,
49 Input,
50 Output,
51 ReadSeek,
52 ReadWrite,
53 ReadWriteSeek,
54 WriteSeek,
55};
56pub use util::Streams;
57pub use wrappers::{
58 ChecksumReader,
59 ChecksumWriter,
60 CountingReader,
61 CountingWriter,
62 LimitReader,
63 LimitWriter,
64 PositionGuard,
65 TeeReader,
66 TeeWriter,
67};