Skip to main content

Module stream_pipe

Module stream_pipe 

Source
Expand description

Copy a file between two filesystems without holding it in memory.

The source’s write_file_to runs on a scoped thread and feeds a bounded channel of chunks; the consumer (usually the target’s create_file) reads the other end. Peak memory is a few chunks, whatever the file’s size. A producer error reaches the consumer as an io::Error rather than a short read, so a failed source never yields a silently truncated copy.

Functions§

with_file_reader
Run consume over a reader that streams entry’s bytes out of source.