Trait FallibleVmWrite

Source
pub trait FallibleVmWrite<F> {
    // Required method
    fn write_fallible(
        &mut self,
        reader: &mut VmReader<'_, F>,
    ) -> Result<usize, (Error, usize)>;
}
Expand description

Fallible memory write from a VmReader.

Required Methods§

Source

fn write_fallible( &mut self, reader: &mut VmReader<'_, F>, ) -> Result<usize, (Error, usize)>

Writes all data from the reader until one of the three conditions is met:

  1. The reader has no remaining data.
  2. The writer has no available space.
  3. The reader/writer encounters some error.

On success, the number of bytes written is returned; On error, both the error and the number of bytes written so far are returned.

Implementors§