pub struct CopyBuffer { /* private fields */ }Expand description
Stack-allocated buffer for efficient file copying.
Uses a fixed-size array on the stack to avoid heap allocations during copy operations. The buffer is reusable across multiple copy operations within the same extraction session.
§Examples
let mut buffer = CopyBuffer::new();
let mut input = std::fs::File::open("input.txt")?;
let mut output = std::fs::File::create("output.txt")?;
let bytes_copied = copy_with_buffer(&mut input, &mut output, &mut buffer)?;
println!("Copied {} bytes", bytes_copied);Implementations§
Trait Implementations§
Source§impl Debug for CopyBuffer
impl Debug for CopyBuffer
Auto Trait Implementations§
impl Freeze for CopyBuffer
impl RefUnwindSafe for CopyBuffer
impl Send for CopyBuffer
impl Sync for CopyBuffer
impl Unpin for CopyBuffer
impl UnwindSafe for CopyBuffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more