vmm_sys_util::write_zeroes

Trait WriteZeroes

Source
pub trait WriteZeroes {
    // Required method
    fn write_zeroes(&mut self, length: usize) -> Result<usize>;

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

A trait for writing zeroes to a stream.

Required Methods§

Source

fn write_zeroes(&mut self, length: usize) -> Result<usize>

Write up to length bytes of zeroes to the stream, returning how many bytes were written.

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

Provided Methods§

Source

fn write_all_zeroes(&mut self, length: usize) -> Result<()>

Write zeroes to the stream 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
  • length: the exact number of bytes of zeroes to write to the stream.

Implementors§