Module io

Module io 

Source
Expand description

I/O wrappers for tracking data transfer.

This module provides ProgressReader and ProgressWriter, which wrap any implementation of std::io::Read or std::io::Write.

§mechanics

These wrappers act as “pass-through” middleware. Every byte successfully read or written automatically increments the associated Progress counter. This is particularly useful for:

  • File downloads/uploads.
  • Hashing large files.
  • Compressing/Decompressing data streams.

The overhead is minimal: a single atomic addition per read or write call.

Structs§

ProgressReader
A wrapper around Read that increments a Progress tracker based on bytes read.
ProgressWriter
A wrapper around Write that increments a Progress tracker based on bytes written.