Skip to main content

PageReader

Trait PageReader 

Source
pub trait PageReader {
    // Required method
    fn read_at(&self, offset_from_ram_start: u64, buf: &mut [u8]) -> Result<()>;
}
Expand description

Reader trait the memory writer pulls page bytes from.

The trait is intentionally minimal so unit tests can stand in an in-memory Vec<u8> and the production path can wrap an applevisor::Memory view.

Required Methods§

Source

fn read_at(&self, offset_from_ram_start: u64, buf: &mut [u8]) -> Result<()>

Fill buf from the source at offset_from_ram_start.

offset_from_ram_start = 0 corresponds to ram_start.

§Errors

Anything the underlying source surfaces; the writer wraps it into SnapshotError::MemoryIo.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§