Trait FileExt

Source
pub trait FileExt {
    // Required methods
    fn copy_to(&self, to: &File) -> Result<u64>;
    fn update_timestamps(&self) -> Result<()>;
    fn pread_exact(&self, buf: &mut [u8], position: usize) -> Result<()>;
}
Expand description

Helper functions for std::fs::File

Required Methods§

Source

fn copy_to(&self, to: &File) -> Result<u64>

👎Deprecated: Use std::io::copy instead

Copy the entire contents of self to to. This uses operating system specific fast paths if available.

Source

fn update_timestamps(&self) -> Result<()>

Update timestamps (both access and modification) to the current time.

Source

fn pread_exact(&self, buf: &mut [u8], position: usize) -> Result<()>

Read the exact number of bytes required to fill buf starting from position, without affecting file offset.

Implementations on Foreign Types§

Source§

impl FileExt for File

Source§

fn copy_to(&self, to: &File) -> Result<u64>

👎Deprecated: Use std::io::copy instead
Source§

fn update_timestamps(&self) -> Result<()>

Source§

fn pread_exact(&self, buf: &mut [u8], start_pos: usize) -> Result<()>

Implementors§