58fn send_frames(values: &[Run], sink: &mut impl std::io::Write) -> std::io::Result<()> {
59let mut body = Vec::new();
60for value in values {
61// Clears the buffer and keeps its allocation, so after an iteration or
62 // two this loop stops allocating altogether.
63structio::write_beve_into(value, &mut body);
64 sink.write_all(&(body.len() as u32).to_le_bytes())?;
65 sink.write_all(&body)?;
66 }
67Ok(())
68}