Trait fuse_backend_rs::api::filesystem::ZeroCopyWriter[][src]

pub trait ZeroCopyWriter: Write {
    fn write_from(
        &mut self,
        f: &mut dyn FileReadWriteVolatile,
        count: usize,
        off: u64
    ) -> Result<usize>; fn write_all_from(
        &mut self,
        f: &mut dyn FileReadWriteVolatile,
        count: usize,
        off: u64
    ) -> Result<()> { ... }
fn copy_to_end(
        &mut self,
        f: &mut dyn FileReadWriteVolatile,
        off: u64
    ) -> 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

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 3 possibilities:

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

Errors

If any error is returned then the implementation must guarantee that no bytes were copied from f. If the underlying read from f returns 0 then the implementation must return an error of the kind io::ErrorKind::UnexpectedEof.

Provided methods

Copies exactly count bytes of data from f at offset off into self. off + count must be less than u64::MAX.

Errors

If an error is returned then the number of bytes copied from self is unspecified but it well never be more than count.

Copies all remaining bytes from f at offset off into self. Equivalent to repeatedly calling write_from until it returns either Ok(0) or a non-ErrorKind::Interrupted error.

Errors

If an error is returned then the number of bytes copied from f is unspecified.

Implementors