vmm_sys_util::write_zeroes

Trait WriteZeroesAt

Source
pub trait WriteZeroesAt {
    // Required method
    fn write_zeroes_at(&mut self, offset: u64, length: usize) -> Result<usize>;

    // Provided method
    fn write_all_zeroes_at(&mut self, offset: u64, length: usize) -> Result<()> { ... }
}
Expand description

A trait for writing zeroes to an arbitrary position in a file.

Required Methods§

Source

fn write_zeroes_at(&mut self, offset: u64, length: usize) -> Result<usize>

Write up to length bytes of zeroes starting at offset, returning how many bytes were written.

§Arguments
  • offset: offset of the file where to write zeroes.
  • length: the number of bytes of zeroes to write to the stream.

Provided Methods§

Source

fn write_all_zeroes_at(&mut self, offset: u64, length: usize) -> Result<()>

Write zeroes starting at offset until length bytes have been written.

This method will continuously write zeroes until the requested length is satisfied or an unrecoverable error is encountered.

§Arguments
  • offset: offset of the file where to write zeroes.
  • length: the exact number of bytes of zeroes to write to the stream.

Implementations on Foreign Types§

Source§

impl WriteZeroesAt for File

Source§

fn write_zeroes_at(&mut self, offset: u64, length: usize) -> Result<usize>

Implementors§