Skip to main content

DmgArchive

Struct DmgArchive 

Source
pub struct DmgArchive { /* private fields */ }
Expand description

High-level DMG archive interface

Implementations§

Source§

impl DmgArchive

Source

pub fn open<P: AsRef<Path>>(path: P) -> Result<Self>

Open a DMG file with default options (checksum verification enabled)

Source

pub fn open_with_options<P: AsRef<Path>>( path: P, options: DmgReaderOptions, ) -> Result<Self>

Open a DMG file with custom options

Source

pub fn stats(&self) -> DmgStats

Get archive statistics

Source

pub fn compression_info(&self) -> CompressionInfo

Get compression info

Source

pub fn partitions(&self) -> Vec<PartitionInfo>

List all partitions

Source

pub fn partition(&self, name: &str) -> Option<PartitionInfo>

Get partition by name

Source

pub fn extract_partition(&mut self, id: i32) -> Result<Vec<u8>>

Extract a partition by ID.

When the parallel feature is enabled, blocks are decompressed in parallel using rayon for significantly faster extraction.

Source

pub fn extract_partition_by_name(&mut self, name: &str) -> Result<Vec<u8>>

Extract a partition by name.

When the parallel feature is enabled, blocks are decompressed in parallel using rayon for significantly faster extraction.

Source

pub fn extract_main_partition(&mut self) -> Result<Vec<u8>>

Extract the main HFS+/APFS partition.

When the parallel feature is enabled, blocks are decompressed in parallel using rayon for significantly faster extraction.

Source

pub fn extract_all(&mut self) -> Result<Vec<u8>>

Extract all partitions as a raw disk image

Source

pub fn extract_partition_to<W: Write>( &mut self, id: i32, writer: &mut W, ) -> Result<u64>

Stream a partition to a writer block-by-block (low memory usage)

Source

pub fn extract_main_partition_to<W: Write>( &mut self, writer: &mut W, ) -> Result<u64>

Stream the main HFS+/APFS partition to a writer (low memory usage)

Source

pub fn main_partition_id(&self) -> Result<i32>

Get the ID of the main HFS+/APFS partition

Source

pub fn hfs_partition_id(&self) -> Result<i32>

Get the ID of the main HFS+/HFSX partition (excludes APFS). Returns Err(FileNotFound) if no HFS-compatible partition exists.

Source

pub fn extract_partition_to_file<P: AsRef<Path>>( &mut self, id: i32, path: P, ) -> Result<()>

Extract a partition to a file

Source

pub fn extract_main_partition_to_file<P: AsRef<Path>>( &mut self, path: P, ) -> Result<()>

Extract main partition to a file

Source

pub fn koly(&self) -> &KolyHeader

Get the raw koly header

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.