vmm_sys_util::file_traits

Trait FileSetLen

Source
pub trait FileSetLen {
    // Required method
    fn set_len(&self, len: u64) -> Result<()>;
}
Expand description

A trait for setting the size of a file.

This is equivalent to std::fd::File::set_len method, but wrapped in a trait so that it can be implemented for other types.

Required Methods§

Source

fn set_len(&self, len: u64) -> Result<()>

Set the size of this file.

This is the moral equivalent of ftruncate.

§Arguments
  • len: the size to set for file.

Implementations on Foreign Types§

Source§

impl FileSetLen for File

Source§

fn set_len(&self, len: u64) -> Result<()>

Implementors§