Trait tk_sendfile::FileReader
[−]
[src]
pub trait FileReader { fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<usize>; }
This trait represents file that can atomically be read at specific point
For unix we implement it for File + AsRawFd
with pread()
system call.
For windows we're implementing it for Mutex<File>
and use seek.
Required Methods
fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<usize>
Read file at specified location
This corresponds to the pread
system call on most unix systems
Implementors
impl FileReader for File