vmm_sys_util::seek_hole

Trait SeekHole

Source
pub trait SeekHole {
    // Required methods
    fn seek_hole(&mut self, offset: u64) -> Result<Option<u64>>;
    fn seek_data(&mut self, offset: u64) -> Result<Option<u64>>;
}
Expand description

A trait for seeking to the next hole or non-hole position in a file.

Required Methods§

Source

fn seek_hole(&mut self, offset: u64) -> Result<Option<u64>>

Seek to the first hole in a file.

Seek at a position greater than or equal to offset. If no holes exist after offset, the seek position will be set to the end of the file. If offset is at or after the end of the file, the seek position is unchanged, and None is returned.

Returns the current seek position after the seek or an error.

Source

fn seek_data(&mut self, offset: u64) -> Result<Option<u64>>

Seek to the first data in a file.

Seek at a position greater than or equal to offset. If no data exists after offset, the seek position is unchanged, and None is returned.

Returns the current offset after the seek or an error.

Implementations on Foreign Types§

Source§

impl SeekHole for File

Source§

fn seek_hole(&mut self, offset: u64) -> Result<Option<u64>>

Source§

fn seek_data(&mut self, offset: u64) -> Result<Option<u64>>

Implementors§