pub struct TokioFileIO;Implementations§
Source§impl TokioFileIO
impl TokioFileIO
Sourcepub fn from_path(path: impl Into<PathBuf>, chunk_size: usize) -> TokioByteSource
pub fn from_path(path: impl Into<PathBuf>, chunk_size: usize) -> TokioByteSource
Creates a Tokio-backed file source that reads path into byte chunks.
The source uses the shared Datum stream Tokio runtime and opens the file
asynchronously when materialized. File reads use a 256 KiB internal
buffer but preserve chunk_size emissions except for the final tail.
Reads have a bounded read-ahead of at most eight emitted chunks; once
that buffer is full, the Tokio task stops reading until downstream
consumes data. The materialized IoResult records the total bytes
read and terminal status.
pub fn from_path_default(path: impl Into<PathBuf>) -> TokioByteSource
Sourcepub fn to_path(path: impl Into<PathBuf>) -> TokioByteSink
pub fn to_path(path: impl Into<PathBuf>) -> TokioByteSink
Creates a Tokio-backed file sink that truncates or creates path.
The sink writes one upstream chunk at a time through a capacity-1 Tokio
channel so a slow file write backpressures the stream. Partial write
failures preserve the number of bytes successfully written in the
materialized IoResult.