pub trait ZeroCopyWriter {
// Required method
fn read_from_file_at(
&mut self,
f: &File,
count: usize,
off: u64,
flags: Option<ReadvFlags>,
) -> Result<usize>;
}Expand description
A trait for directly copying data from a File into the fuse transport without first storing
it in an intermediate buffer.
Required Methods§
Sourcefn read_from_file_at(
&mut self,
f: &File,
count: usize,
off: u64,
flags: Option<ReadvFlags>,
) -> Result<usize>
fn read_from_file_at( &mut self, f: &File, count: usize, off: u64, flags: Option<ReadvFlags>, ) -> Result<usize>
Copies at most count bytes from f at offset off directly into self without storing
it in any intermediate buffers. If the return value is Ok(n) then it must be guaranteed
that 0 <= n <= count. If n is 0, then it can indicate one of 4 possibilities:
- There is no more data left in
f. - End of
freached. - There is no more space in
self. countwas0.
Does not do short reads, unless one of the above happens; i.e. will invoke the underlying
file read function until count bytes have been read or it returns 0 (cases 1 or 2 above)
or self has no more space (case 2 above).