pub enum MachoContainer<'data> {
Thin(MachoFile<'data>),
Fat(FatBinary<'data>),
}Expand description
Parsed thin or fat Mach-O input.
Variants§
Thin(MachoFile<'data>)
One standalone Mach-O image.
Fat(FatBinary<'data>)
A validated non-empty fat container.
Implementations§
Source§impl<'data> MachoContainer<'data>
impl<'data> MachoContainer<'data>
Sourcepub fn bytes(&self) -> &'data [u8] ⓘ
pub fn bytes(&self) -> &'data [u8] ⓘ
Complete bytes of the original thin or universal Mach-O input.
Sourcepub fn macho_files(&self) -> MachoFiles<'_, 'data> ⓘ
pub fn macho_files(&self) -> MachoFiles<'_, 'data> ⓘ
Iterate parsed images without allocating a temporary collection.
Sourcepub fn first_macho(&self) -> Option<&MachoFile<'data>>
pub fn first_macho(&self) -> Option<&MachoFile<'data>>
Return the first image when one exists.
Sourcepub fn find_arch(&self, cpu_type: CpuType) -> Option<&MachoFile<'data>>
pub fn find_arch(&self, cpu_type: CpuType) -> Option<&MachoFile<'data>>
Find an image by CPU type.
Sourcepub fn find_arch_spec(
&self,
cpu_type: CpuType,
cpu_subtype: CpuSubtype,
) -> Option<&MachoFile<'data>>
pub fn find_arch_spec( &self, cpu_type: CpuType, cpu_subtype: CpuSubtype, ) -> Option<&MachoFile<'data>>
Find an image by CPU type and masked subtype.
Sourcepub fn select_exact(
&self,
key: SelectionKey,
) -> Result<SelectedImage<'_, 'data>, ParseError>
pub fn select_exact( &self, key: SelectionKey, ) -> Result<SelectedImage<'_, 'data>, ParseError>
Select exactly one image by table index and architecture.
This is the canonical selection boundary for consumers that retain an image identity across parse, inspection, and mutation. Both fields are checked so a stale index cannot silently retarget after container drift.
Trait Implementations§
Auto Trait Implementations§
impl<'data> Freeze for MachoContainer<'data>
impl<'data> RefUnwindSafe for MachoContainer<'data>
impl<'data> Send for MachoContainer<'data>
impl<'data> Sync for MachoContainer<'data>
impl<'data> Unpin for MachoContainer<'data>
impl<'data> UnsafeUnpin for MachoContainer<'data>
impl<'data> UnwindSafe for MachoContainer<'data>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more