ZeroCopyReader

Trait ZeroCopyReader 

Source
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§

Source

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:

  1. There is no more data left in self.
  2. There is no more space in f.
  3. count was 0.

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).

Implementations on Foreign Types§

Source§

impl<R: ZeroCopyReader> ZeroCopyReader for &mut R

Source§

fn write_to_file_at( &mut self, f: &File, count: usize, off: u64, flags: Option<WritevFlags>, ) -> Result<usize>

Implementors§