Skip to main content

FallibleVmRead

Trait FallibleVmRead 

Source
pub trait FallibleVmRead<F> {
    // Required method
    fn read_fallible(
        &mut self,
        writer: &mut VmWriter<'_, F>,
    ) -> Result<usize, (Error, usize)>;
}
Expand description

Fallible memory read from a VmWriter.

Required Methods§

Source

fn read_fallible( &mut self, writer: &mut VmWriter<'_, F>, ) -> Result<usize, (Error, usize)>

Reads all data into the writer 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 read is returned; On error, both the error and the number of bytes read so far are returned.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§