pub struct DmgArchive { /* private fields */ }Expand description
High-level DMG archive interface
Implementations§
Source§impl DmgArchive
impl DmgArchive
Sourcepub fn open<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn open<P: AsRef<Path>>(path: P) -> Result<Self>
Open a DMG file with default options (checksum verification enabled)
Sourcepub fn open_with_options<P: AsRef<Path>>(
path: P,
options: DmgReaderOptions,
) -> Result<Self>
pub fn open_with_options<P: AsRef<Path>>( path: P, options: DmgReaderOptions, ) -> Result<Self>
Open a DMG file with custom options
Sourcepub fn compression_info(&self) -> CompressionInfo
pub fn compression_info(&self) -> CompressionInfo
Get compression info
Sourcepub fn partitions(&self) -> Vec<PartitionInfo>
pub fn partitions(&self) -> Vec<PartitionInfo>
List all partitions
Sourcepub fn partition(&self, name: &str) -> Option<PartitionInfo>
pub fn partition(&self, name: &str) -> Option<PartitionInfo>
Get partition by name
Sourcepub fn extract_partition(&mut self, id: i32) -> Result<Vec<u8>>
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.
Sourcepub fn extract_partition_by_name(&mut self, name: &str) -> Result<Vec<u8>>
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.
Sourcepub fn extract_main_partition(&mut self) -> Result<Vec<u8>>
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.
Sourcepub fn extract_all(&mut self) -> Result<Vec<u8>>
pub fn extract_all(&mut self) -> Result<Vec<u8>>
Extract all partitions as a raw disk image
Sourcepub fn extract_partition_to<W: Write>(
&mut self,
id: i32,
writer: &mut W,
) -> Result<u64>
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)
Sourcepub fn extract_main_partition_to<W: Write>(
&mut self,
writer: &mut W,
) -> Result<u64>
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)
Sourcepub fn main_partition_id(&self) -> Result<i32>
pub fn main_partition_id(&self) -> Result<i32>
Get the ID of the main HFS+/APFS partition
Sourcepub fn hfs_partition_id(&self) -> Result<i32>
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.
Sourcepub fn extract_partition_to_file<P: AsRef<Path>>(
&mut self,
id: i32,
path: P,
) -> Result<()>
pub fn extract_partition_to_file<P: AsRef<Path>>( &mut self, id: i32, path: P, ) -> Result<()>
Extract a partition to a file
Sourcepub fn extract_main_partition_to_file<P: AsRef<Path>>(
&mut self,
path: P,
) -> Result<()>
pub fn extract_main_partition_to_file<P: AsRef<Path>>( &mut self, path: P, ) -> Result<()>
Extract main partition to a file
Sourcepub fn koly(&self) -> &KolyHeader
pub fn koly(&self) -> &KolyHeader
Get the raw koly header