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§
Macros§
Structs§
- Checksum
Reader - Reader wrapper that updates a checksum hasher with bytes read.
- Checksum
Writer - Writer wrapper that updates a checksum hasher with bytes written.
- Counting
Reader - Reader wrapper that counts successfully read bytes.
- Counting
Writer - Writer wrapper that counts successfully written bytes.
- Limit
Reader - Reader wrapper that exposes at most a fixed number of bytes.
- Limit
Writer - Writer wrapper that accepts at most a fixed number of bytes.
- Position
Guard - Guard that restores a seekable stream to its original position.
- Sync
Seek TeeReader - 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.
- Unchecked
Slice - Namespace for low-level slice operations without bound checks.
Constants§
- DEFAULT_
BUFFER_ CAPACITY - Default capacity used by
BufferedInputandBufferedOutput. - 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§
- BufRead
Seek - 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.
- Read
Seek - Object-safe capability trait for values that can be read and repositioned.
- Read
Write - Object-safe capability trait for values that can be both read and written.
- Read
Write Seek - Object-safe capability trait for values that can be read, written, and repositioned.
- Seekable
- Minimal seek interface measured in stream items.
- Seekable
Input - Object-safe capability trait for inputs that can be read and repositioned in the same item space.
- Seekable
Output - Object-safe capability trait for outputs that can be written and repositioned in the same item space.
- Write
Seek - Object-safe capability trait for values that can be written and repositioned.
Functions§
- nz
- Returns a
NonZeroUsizefrom a known non-zero compile-time constant. - nz_
const - Re-export of
nzunder the name expected bynz!. - 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.