pub trait WriteExt: Write {
// Required methods
fn reserve_with(
&mut self,
additional: usize,
) -> Result<&mut [MaybeUninit<u8>]>;
unsafe fn flush_len(&mut self, additional: usize);
}
Expand description
The trait is a extension to io::Write
with a reserved capacity.
Required Methods§
Sourcefn reserve_with(&mut self, additional: usize) -> Result<&mut [MaybeUninit<u8>]>
fn reserve_with(&mut self, additional: usize) -> Result<&mut [MaybeUninit<u8>]>
Reserve with additional
capacity and returns the remaining spare capacity of the write as
a slice of MaybeUninit<u8>
.
The returned slice will be used to write new data before marking the data as initialized
using the WriteExt::flush_len
method.