Skip to main content

PhysicalMemoryProvider

Trait PhysicalMemoryProvider 

Source
pub trait PhysicalMemoryProvider: Send + Sync {
    // Required methods
    fn read_phys(&self, addr: u64, buf: &mut [u8]) -> Result<usize>;
    fn ranges(&self) -> &[PhysicalRange];
    fn format_name(&self) -> &str;

    // Provided methods
    fn total_size(&self) -> u64 { ... }
    fn metadata(&self) -> Option<DumpMetadata> { ... }
}
Expand description

A provider of physical memory from a dump file.

Required Methods§

Source

fn read_phys(&self, addr: u64, buf: &mut [u8]) -> Result<usize>

Read up to buf.len() bytes starting at physical address addr. Returns the number of bytes actually read (may be less if crossing a gap).

Source

fn ranges(&self) -> &[PhysicalRange]

Return all valid physical address ranges in the dump.

Source

fn format_name(&self) -> &str

Human-readable format name (e.g., “LiME”, “AVML v2”).

Provided Methods§

Source

fn total_size(&self) -> u64

Total physical memory size (sum of all range lengths).

Source

fn metadata(&self) -> Option<DumpMetadata>

Optional metadata extracted from the dump header. Returns None for formats that carry no metadata (Raw, LiME, AVML).

Trait Implementations§

Source§

impl PhysicalMemoryProvider for Box<dyn PhysicalMemoryProvider>

Source§

fn read_phys(&self, addr: u64, buf: &mut [u8]) -> Result<usize>

Read up to buf.len() bytes starting at physical address addr. Returns the number of bytes actually read (may be less if crossing a gap).
Source§

fn ranges(&self) -> &[PhysicalRange]

Return all valid physical address ranges in the dump.
Source§

fn total_size(&self) -> u64

Total physical memory size (sum of all range lengths).
Source§

fn format_name(&self) -> &str

Human-readable format name (e.g., “LiME”, “AVML v2”).
Source§

fn metadata(&self) -> Option<DumpMetadata>

Optional metadata extracted from the dump header. Returns None for formats that carry no metadata (Raw, LiME, AVML).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl PhysicalMemoryProvider for Arc<dyn PhysicalMemoryProvider>

Source§

fn read_phys(&self, addr: u64, buf: &mut [u8]) -> Result<usize>

Source§

fn ranges(&self) -> &[PhysicalRange]

Source§

fn total_size(&self) -> u64

Source§

fn format_name(&self) -> &str

Source§

fn metadata(&self) -> Option<DumpMetadata>

Source§

impl PhysicalMemoryProvider for Box<dyn PhysicalMemoryProvider>

Source§

fn read_phys(&self, addr: u64, buf: &mut [u8]) -> Result<usize>

Source§

fn ranges(&self) -> &[PhysicalRange]

Source§

fn total_size(&self) -> u64

Source§

fn format_name(&self) -> &str

Source§

fn metadata(&self) -> Option<DumpMetadata>

Implementors§