[−][src]Trait basic_tar::WriteExt
An extension for Write
Required methods
fn try_write_exact(
&mut self,
data: &[u8],
counter: impl FnMut(usize)
) -> Result<(), Error>
&mut self,
data: &[u8],
counter: impl FnMut(usize)
) -> Result<(), Error>
Tries to write data
completely and calls the position callback pos_cb
with the amount of
bytes written on every successful write
call
Note: This function behaves like write_exact
, except that you will never loose state in
case of an incomplete write - if the error is non-fatal (like TimedOut
), you can always
try again later from the last position as if nothing happened
fn try_fill(
&mut self,
len: usize,
counter: impl FnMut(usize)
) -> Result<(), Error>
&mut self,
len: usize,
counter: impl FnMut(usize)
) -> Result<(), Error>
Tries to write len
zero bytes and calls the position callback pos_cb
with the amount of
bytes written on every successful write
call
Note: This function behaves similar to write_exact
(without data), except that you will
never loose state in case of an incomplete write - if the error is non-fatal (like
TimedOut
), you can always try again later if nothing happened