pub struct Reader<'parser> { /* private fields */ }Expand description
A reader lets you translate & read physical memory from a dump file.
Implementations§
Source§impl<'parser> Reader<'parser>
impl<'parser> Reader<'parser>
pub fn new(parser: &'parser KernelDumpParser) -> Self
Sourcepub fn translate(&self, gpa: Gpa) -> Result<SeekFrom>
pub fn translate(&self, gpa: Gpa) -> Result<SeekFrom>
Translate a Gpa into a file offset. At that file offset is where the
content of the page resides in.
Sourcepub fn read_exact(&self, gpa: Gpa, buf: &mut [u8]) -> Result<()>
pub fn read_exact(&self, gpa: Gpa, buf: &mut [u8]) -> Result<()>
Read the exact amount of bytes asked by the user & return a
Error::PartialRead error if it couldn’t read as much as
wanted.
Sourcepub fn read(&self, gpa: Gpa, buf: &mut [u8]) -> Result<usize>
pub fn read(&self, gpa: Gpa, buf: &mut [u8]) -> Result<usize>
Read the physical memory starting at gpa into buf. If it cannot read
as much as asked by the user because the dump file is missing a physical
memory page, the function doesn’t error out and return the amount of
bytes that was successfully read.
Sourcepub fn read_struct<T>(&self, gpa: Gpa) -> Result<T>
pub fn read_struct<T>(&self, gpa: Gpa) -> Result<T>
Read a T from physical memory.
Auto Trait Implementations§
impl<'parser> Freeze for Reader<'parser>
impl<'parser> !RefUnwindSafe for Reader<'parser>
impl<'parser> !Send for Reader<'parser>
impl<'parser> !Sync for Reader<'parser>
impl<'parser> Unpin for Reader<'parser>
impl<'parser> !UnwindSafe for Reader<'parser>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more