Skip to main content

Crate qubit_io

Crate qubit_io 

Source
Expand description

§Qubit IO

Unit-oriented buffering and small I/O trait utilities for Rust.

This crate provides named, object-safe composition traits for common std::io capability combinations and small extension traits for recurring standard-library I/O patterns.

It also provides item-oriented buffering primitives in buffered: Buffer, BufferedInput, BufferedOutput, EnsuredBufferedInput, and EnsuredBufferedOutput. These types are intentionally format-agnostic. Binary and text stream adapters live in sibling crates and build their codec-specific behavior on top of these item windows.

The concrete trait definitions and wrapper types live in dedicated modules and are re-exported from the crate root for ergonomic use.

Re-exports§

pub use buffered::Buffer;
pub use buffered::BufferedInput;
pub use buffered::BufferedOutput;
pub use buffered::EnsuredBufferedInput;
pub use buffered::EnsuredBufferedOutput;
pub use ext::BufReadExt;
pub use ext::ReadExt;
pub use ext::ReadSeekExt;
pub use ext::SeekExt;
pub use ext::WriteExt;
pub use ext::WriteSeekExt;

Modules§

buffered
Shared item-oriented buffering primitives.
ext
Extension traits for standard I/O.

Macros§

nz
Const-friendly wrapper around nz for use in expression position.

Structs§

ChecksumReader
Reader wrapper that updates a checksum hasher with bytes read.
ChecksumWriter
Writer wrapper that updates a checksum hasher with bytes written.
CountingReader
Reader wrapper that counts successfully read bytes.
CountingWriter
Writer wrapper that counts successfully written bytes.
LimitReader
Reader wrapper that exposes at most a fixed number of bytes.
LimitWriter
Writer wrapper that accepts at most a fixed number of bytes.
PositionGuard
Guard that restores a seekable stream to its original position.
SyncSeekTeeReader
Reader wrapper that mirrors read bytes and keeps the branch seek position in sync.
TeeReader
Reader wrapper that mirrors read bytes into a branch writer.
TeeWriter
Writer wrapper that mirrors accepted bytes into a branch writer.

Enums§

Streams
Stream utility namespace.
UncheckedSlice
Namespace for low-level slice operations without bound checks.

Constants§

DEFAULT_BUFFER_CAPACITY
Default capacity used by BufferedInput and BufferedOutput.
DEFAULT_COMPARE_BUFFER_SIZE
Default buffer size used by stream comparison operations.
DEFAULT_COPY_BUFFER_SIZE
Default buffer size used by stream copy operations.

Traits§

BufReadSeek
Object-safe capability trait for values that can be buffered-read and repositioned.
Input
Minimal indexed input interface over items.
Output
Minimal indexed output interface over items.
ReadSeek
Object-safe capability trait for values that can be read and repositioned.
ReadWrite
Object-safe capability trait for values that can be both read and written.
ReadWriteSeek
Object-safe capability trait for values that can be read, written, and repositioned.
Seekable
Minimal seek interface measured in stream items.
SeekableInput
Object-safe capability trait for inputs that can be read and repositioned in the same item space.
SeekableOutput
Object-safe capability trait for outputs that can be written and repositioned in the same item space.
WriteSeek
Object-safe capability trait for values that can be written and repositioned.

Functions§

nz
Returns a NonZeroUsize from a known non-zero compile-time constant.
nz_const
Re-export of nz under the name expected by nz!.
try_reserve_string
Reserves capacity in a string and reports allocation failure as an I/O error.
try_reserve_vec
Reserves capacity in a vector and reports allocation failure as an I/O error.