Reader

Struct Reader 

Source
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>

Source

pub fn new(parser: &'parser KernelDumpParser) -> Self

Source

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.

Source

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.

Source

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.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.