[][src]Struct metagoblin::mach::fat::FatArch

#[repr(C)]pub struct FatArch {
    pub cputype: u32,
    pub cpusubtype: u32,
    pub offset: u32,
    pub size: u32,
    pub align: u32,
}

The Mach-o FatArch always has its data bigendian

Fields

cputype: u32

What kind of CPU this binary is

cpusubtype: u32offset: u32

Where in the fat binary it starts

size: u32

How big the binary is

align: u32

Implementations

impl FatArch[src]

pub fn slice(&self, bytes: &'a [u8]) -> &'a [u8][src]

Get the slice of bytes this header describes from bytes

pub fn cputype(&self) -> u32[src]

Returns the cpu type

pub fn cpusubtype(&self) -> u32[src]

Returns the cpu subtype with the capabilities removed

pub fn cpu_caps(&self) -> u32[src]

Returns the capabilities of the CPU

pub fn is_64(&self) -> bool[src]

Whether this fat architecture header describes a 64-bit binary

pub fn parse(bytes: &[u8], offset: usize) -> Result<FatArch, Error>[src]

Parse a FatArch header from bytes at offset

Trait Implementations

impl Clone for FatArch[src]

impl Copy for FatArch[src]

impl Debug for FatArch[src]

impl Default for FatArch[src]

impl SizeWith<Endian> for FatArch[src]

impl<'a> TryFromCtx<'a, Endian, [u8]> for FatArch where
    FatArch: 'a, 
[src]

type Error = Error

impl<'a> TryIntoCtx<Endian, [u8]> for &'a FatArch[src]

type Error = Error

impl TryIntoCtx<Endian, [u8]> for FatArch[src]

type Error = Error

Auto Trait Implementations

impl RefUnwindSafe for FatArch

impl Send for FatArch

impl Sync for FatArch

impl Unpin for FatArch

impl UnwindSafe for FatArch

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.