pub trait ZeroCopyReader {
// Required method
fn write_to_file_at(
&mut self,
f: &File,
count: usize,
off: u64,
flags: Option<WritevFlags>,
) -> Result<usize>;
}
Expand description
A trait for directly copying data from the fuse transport into a File
without first storing it
in an intermediate buffer.
Required Methods§
Sourcefn write_to_file_at(
&mut self,
f: &File,
count: usize,
off: u64,
flags: Option<WritevFlags>,
) -> Result<usize>
fn write_to_file_at( &mut self, f: &File, count: usize, off: u64, flags: Option<WritevFlags>, ) -> Result<usize>
Copies at most count
bytes from self
directly into f
at offset off
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 3 possibilities:
- There is no more data left in
self
. - There is no more space in
f
. count
was0
.
Does not do short writes, unless one of the above happens; i.e. will invoke the underlying
file write function until count
bytes have been written or it returns 0 (case 2 above) or
self
is empty (case 1 above).