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§
Sourcefn read_fallible(
&mut self,
writer: &mut VmWriter<'_, F>,
) -> Result<usize, (Error, usize)>
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:
- The reader has no remaining data.
- The writer has no available space.
- 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.