[−][src]Struct symbolic::debuginfo::macho::MachArchive
An archive that can consist of a single MachObject
or a FatMachO
container.
Executables and dSYM files on macOS can be a so-called Fat Mach Object: It contains multiple objects for several architectures. When loading this object, the operating system determines the object corresponding to the host's architecture. This allows to distribute a single binary with optimizations for specific CPUs, which is frequently done on iOS.
To abstract over the differences, MachArchive
simulates the archive interface also for single
Mach objects. This allows uniform access to both file types.
Implementations
impl<'d> MachArchive<'d>
[src]
pub fn test(data: &[u8]) -> bool
[src]
Tests whether the buffer contains either a Mach Object or a Fat Mach Object.
pub fn parse(data: &'d [u8]) -> Result<MachArchive<'d>, MachError>
[src]
Tries to parse a Mach archive from the given slice.
pub fn objects(&self) -> MachObjectIterator<'d, '_>ⓘNotable traits for MachObjectIterator<'d, 'a>
impl<'d, 'a> Iterator for MachObjectIterator<'d, 'a> type Item = Result<MachObject<'d>, MachError>;
[src]
Notable traits for MachObjectIterator<'d, 'a>
impl<'d, 'a> Iterator for MachObjectIterator<'d, 'a> type Item = Result<MachObject<'d>, MachError>;
Returns an iterator over all objects contained in this archive.
pub fn object_count(&self) -> usize
[src]
Returns the number of objects in this archive.
pub fn object_by_index(
&self,
index: usize
) -> Result<Option<MachObject<'d>>, MachError>
[src]
&self,
index: usize
) -> Result<Option<MachObject<'d>>, MachError>
Resolves the object at the given index.
Returns Ok(None)
if the index is out of bounds, or Err
if the object exists but cannot
be parsed.
pub fn is_multi(&self) -> bool
[src]
Returns whether this is a multi-object archive.
This may also return true if there is only a single object inside the archive.
Trait Implementations
impl<'slf, 'd> AsSelf<'slf> for MachArchive<'d> where
'd: 'slf,
[src]
'd: 'slf,
type Ref = MachArchive<'slf>
The Self
type with 'slf
lifetimes, returned by as_self
.
fn as_self(&'slf self) -> &'slf <MachArchive<'d> as AsSelf<'slf>>::Ref
[src]
impl<'d> Debug for MachArchive<'d>
[src]
Auto Trait Implementations
impl<'d> RefUnwindSafe for MachArchive<'d>
impl<'d> Send for MachArchive<'d>
impl<'d> Sync for MachArchive<'d>
impl<'d> Unpin for MachArchive<'d>
impl<'d> UnwindSafe for MachArchive<'d>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,