Skip to main content

copy_bidirectional

Function copy_bidirectional 

Source
pub async fn copy_bidirectional<A, B>(
    a: &mut A,
    b: &mut B,
) -> Result<(u64, u64)>
Expand description

Copies a into b and b into a at once, in the calling task, each direction through a buffer of 8 KiB; a direction whose reader ends closes its writer. Answers the bytes copied each way, (a to b, b to a), once both ended; the first error ends both.