Skip to main content

write_chunks

Function write_chunks 

Source
pub fn write_chunks<'a, P, I>(
    out_dir: P,
    chunks: I,
    prefix: &str,
) -> Result<Vec<String>>
where P: AsRef<Path>, I: Iterator<Item = (usize, &'a str)>,
Expand description

Writes chunks to individual files in a directory.

§Arguments

  • out_dir - Directory to write chunks to.
  • chunks - Iterator of (index, content) pairs.
  • prefix - Filename prefix (e.g., “chunk”).

§Returns

Vector of paths to the written files.

§Errors

Returns an error if directory creation or file writing fails.