Expand description
A CHD (MAME Compressed Hunks of Data) file.
Implementations
sourceimpl<F: Read + Seek> ChdFile<F>
impl<F: Read + Seek> ChdFile<F>
sourcepub fn open(file: F, parent: Option<Box<ChdFile<F>>>) -> Result<ChdFile<F>>
pub fn open(file: F, parent: Option<Box<ChdFile<F>>>) -> Result<ChdFile<F>>
Open a CHD file from a Read + Seek
stream. Optionally provide a parent of the same stream
type.
The CHD header and hunk map are read and validated immediately.
sourcepub fn metadata_refs(&mut self) -> MetadataRefIter<'_, F>ⓘNotable traits for MetadataRefIter<'a, F>impl<'a, F: Read + Seek + 'a> Iterator for MetadataRefIter<'a, F> type Item = MetadataRef;
pub fn metadata_refs(&mut self) -> MetadataRefIter<'_, F>ⓘNotable traits for MetadataRefIter<'a, F>impl<'a, F: Read + Seek + 'a> Iterator for MetadataRefIter<'a, F> type Item = MetadataRef;
Returns an iterator over references to metadata entries for this CHD file.
The contents of each metadata entry are lazily read.
sourcepub fn metadata(&mut self) -> MetadataIter<'_, F>
Available on unsound_owning_iterators
or unstable_lending_iterators
only.
pub fn metadata(&mut self) -> MetadataIter<'_, F>
unsound_owning_iterators
or unstable_lending_iterators
only.Returns an iterator over metadata entries for this CHD file.
The contents of each metadata entry are lazily read.
sourcepub fn hunk(&mut self, hunk_num: u32) -> Result<ChdHunk<'_, F>>
pub fn hunk(&mut self, hunk_num: u32) -> Result<ChdHunk<'_, F>>
Returns a reference to the given hunk in this CHD file.
If the requested hunk is larger than the number of hunks in the CHD file,
returns ChdError::HunkOutOfRange
.
sourcepub fn get_hunksized_buffer(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn get_hunksized_buffer(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Allocates a buffer with the same length as the hunk size of this CHD file.
sourcepub fn hunks(&mut self) -> HunkIter<'_, F>
Available on unsound_owning_iterators
or unstable_lending_iterators
only.
pub fn hunks(&mut self) -> HunkIter<'_, F>
unsound_owning_iterators
or unstable_lending_iterators
only.Returns an iterator over the hunks of this CHD file.
sourcepub fn into_inner(self) -> F
pub fn into_inner(self) -> F
Consumes the ChdFile
and returns the underlying reader.
Auto Trait Implementations
impl<F> !RefUnwindSafe for ChdFile<F>
impl<F> !Send for ChdFile<F>
impl<F> !Sync for ChdFile<F>
impl<F> Unpin for ChdFile<F> where
F: Unpin,
impl<F> !UnwindSafe for ChdFile<F>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more