Struct minidump::Minidump[][src]

pub struct Minidump<'a, T> where
    T: Deref<Target = [u8]> + 'a, 
{ pub header: MINIDUMP_HEADER, pub endian: Endian, // some fields omitted }
Expand description

An index into the contents of a minidump.

The Minidump struct represents the parsed header and indices contained at the start of a minidump file. It can be instantiated by calling the Minidump::read or Minidump::read_path methods.

Examples

use minidump::Minidump;

let dump = Minidump::read_path("../testdata/test.dmp")?;

Fields

header: MINIDUMP_HEADER

The raw minidump header from the file.

endian: Endian

The endianness of this minidump file.

Implementations

impl<'a> Minidump<'a, Mmap>[src]

pub fn read_path<P>(path: P) -> Result<Minidump<'a, Mmap>, Error> where
    P: AsRef<Path>, 
[src]

Read a Minidump from a Path to a file on disk.

See the type definition for an example.

impl<'a, T> Minidump<'a, T> where
    T: Deref<Target = [u8]> + 'a, 
[src]

pub fn read(data: T) -> Result<Minidump<'a, T>, Error>[src]

Read a Minidump from the provided data.

Typically this will be a Vec<u8> or &[u8] with the full contents of the minidump, but you can also use something like memmap::Mmap.

pub fn get_stream<S>(&'a self) -> Result<S, Error> where
    S: MinidumpStream<'a>, 
[src]

Get a known stream of data from the minidump.

For streams known to this module whose types implement the MinidumpStream trait, this method allows reading the stream data as a specific type.

Note that the lifetime of the returned stream is bound to the lifetime of the this Minidump struct itself and not to the lifetime of the data backing this minidump. This is a consequence of how this struct relies on Deref to access the data.

pub fn get_raw_stream<S>(&'a self, stream_type: S) -> Result<&'a [u8], Error> where
    S: Into<u32>, 
[src]

Get a stream of raw data from the minidump.

This can be used to get the contents of arbitrary minidump streams. For streams of known types you almost certainly want to use get_stream instead.

Note that the lifetime of the returned stream is bound to the lifetime of the this Minidump struct itself and not to the lifetime of the data backing this minidump. This is a consequence of how this struct relies on Deref to access the data.

pub fn print<W: Write>(&self, f: &mut W) -> Result<()>[src]

Write a verbose description of the Minidump to f.

Trait Implementations

impl<'a, T: Debug> Debug for Minidump<'a, T> where
    T: Deref<Target = [u8]> + 'a, 
[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for Minidump<'a, T> where
    T: RefUnwindSafe

impl<'a, T> Send for Minidump<'a, T> where
    T: Send

impl<'a, T> Sync for Minidump<'a, T> where
    T: Sync

impl<'a, T> Unpin for Minidump<'a, T> where
    T: Unpin

impl<'a, T> UnwindSafe for Minidump<'a, T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.