Trait object::read::macho::MachHeader[][src]

pub trait MachHeader: Debug + Pod {
    type Word: Into<u64>;
    type Endian: Endian;
    type Segment: Segment<Endian = Self::Endian, Section = Self::Section>;
    type Section: Section<Endian = Self::Endian>;
    type Nlist: Nlist<Endian = Self::Endian>;
    fn is_type_64(&self) -> bool;
fn is_big_endian(&self) -> bool;
fn is_little_endian(&self) -> bool;
fn magic(&self) -> u32;
fn cputype(&self, endian: Self::Endian) -> u32;
fn cpusubtype(&self, endian: Self::Endian) -> u32;
fn filetype(&self, endian: Self::Endian) -> u32;
fn ncmds(&self, endian: Self::Endian) -> u32;
fn sizeofcmds(&self, endian: Self::Endian) -> u32;
fn flags(&self, endian: Self::Endian) -> u32; fn parse<'data>(data: Bytes<'data>) -> Result<&'data Self> { ... }
fn is_supported(&self) -> bool { ... }
fn endian(&self) -> Result<Self::Endian> { ... }
fn load_commands<'data>(
        &self,
        endian: Self::Endian,
        data: Bytes<'data>
    ) -> Result<MachOLoadCommandIterator<'data, Self::Endian>> { ... }
fn uuid<'data>(
        &self,
        endian: Self::Endian,
        data: Bytes<'data>
    ) -> Result<Option<[u8; 16]>> { ... } }

A trait for generic access to MachHeader32 and MachHeader64.

Associated Types

type Word: Into<u64>[src]

type Endian: Endian[src]

type Segment: Segment<Endian = Self::Endian, Section = Self::Section>[src]

type Section: Section<Endian = Self::Endian>[src]

type Nlist: Nlist<Endian = Self::Endian>[src]

Loading content...

Required methods

fn is_type_64(&self) -> bool[src]

Return true if this type is a 64-bit header.

This is a property of the type, not a value in the header data.

fn is_big_endian(&self) -> bool[src]

Return true if the magic field signifies big-endian.

fn is_little_endian(&self) -> bool[src]

Return true if the magic field signifies little-endian.

fn magic(&self) -> u32[src]

fn cputype(&self, endian: Self::Endian) -> u32[src]

fn cpusubtype(&self, endian: Self::Endian) -> u32[src]

fn filetype(&self, endian: Self::Endian) -> u32[src]

fn ncmds(&self, endian: Self::Endian) -> u32[src]

fn sizeofcmds(&self, endian: Self::Endian) -> u32[src]

fn flags(&self, endian: Self::Endian) -> u32[src]

Loading content...

Provided methods

fn parse<'data>(data: Bytes<'data>) -> Result<&'data Self>[src]

Read the file header.

Also checks that the magic field in the file header is a supported format.

fn is_supported(&self) -> bool[src]

fn endian(&self) -> Result<Self::Endian>[src]

fn load_commands<'data>(
    &self,
    endian: Self::Endian,
    data: Bytes<'data>
) -> Result<MachOLoadCommandIterator<'data, Self::Endian>>
[src]

fn uuid<'data>(
    &self,
    endian: Self::Endian,
    data: Bytes<'data>
) -> Result<Option<[u8; 16]>>
[src]

Return the UUID from the LC_UUID load command, if one is present.

Loading content...

Implementors

impl<Endian: Endian> MachHeader for MachHeader32<Endian>[src]

type Word = u32

type Endian = Endian

type Segment = SegmentCommand32<Endian>

type Section = Section32<Endian>

type Nlist = Nlist32<Endian>

impl<Endian: Endian> MachHeader for MachHeader64<Endian>[src]

type Word = u64

type Endian = Endian

type Segment = SegmentCommand64<Endian>

type Section = Section64<Endian>

type Nlist = Nlist64<Endian>

Loading content...