pub enum Header {
V1Header(HeaderV1),
V2Header(HeaderV1),
V3Header(HeaderV3),
V4Header(HeaderV4),
V5Header(HeaderV5),
}
Expand description
A CHD header of unspecified version.
Variants§
V1Header(HeaderV1)
A CHD V1 header.
V2Header(HeaderV1)
A CHD V2 header.
V3Header(HeaderV3)
A CHD V3 header.
V4Header(HeaderV4)
A CHD V4 header.
V5Header(HeaderV5)
A CHD V5 header.
Implementations§
source§impl Header
impl Header
sourcepub fn try_read_header<F: Read + Seek>(file: &mut F) -> Result<Header>
pub fn try_read_header<F: Read + Seek>(file: &mut F) -> Result<Header>
Reads CHD header data from the provided stream.
If the header is not valid, returns Error::InvalidParameter
.
If the header indicates an unsupported compression format, returns Error::UnsupportedFormat
sourcepub fn is_compressed(&self) -> bool
pub fn is_compressed(&self) -> bool
Returns whether or not the CHD file is compressed.
sourcepub fn meta_offset(&self) -> Option<u64>
pub fn meta_offset(&self) -> Option<u64>
Returns the offset of the CHD metadata, if available.
sourcepub fn hunk_count(&self) -> u32
pub fn hunk_count(&self) -> u32
Returns the total number of hunks in the CHD file.
sourcepub fn logical_bytes(&self) -> u64
pub fn logical_bytes(&self) -> u64
Returns the logical size of the compressed data in bytes.
sourcepub fn unit_bytes(&self) -> u32
pub fn unit_bytes(&self) -> u32
Returns the number of bytes per unit within each hunk.
sourcepub fn unit_count(&self) -> u64
pub fn unit_count(&self) -> u64
Returns the number of units per hunk.
sourcepub fn has_parent(&self) -> bool
pub fn has_parent(&self) -> bool
Returns whether or not this CHD file has a parent.
sourcepub fn parent_sha1(&self) -> Option<[u8; 20]>
pub fn parent_sha1(&self) -> Option<[u8; 20]>
Returns the SHA1 of the parent of the CHD if available.
sourcepub fn raw_sha1(&self) -> Option<[u8; 20]>
pub fn raw_sha1(&self) -> Option<[u8; 20]>
Returns the raw (hunk data only) SHA1 of the CHD file if available.
sourcepub fn parent_md5(&self) -> Option<[u8; 16]>
pub fn parent_md5(&self) -> Option<[u8; 16]>
Returns the MD5 of the parent CHD file if available.