Skip to main content

FatArch

Trait FatArch 

Source
pub trait FatArch: Pod {
    type Word: Into<u64>;

    const MAGIC: u32;

    // Required methods
    fn cputype(&self) -> u32;
    fn cpusubtype(&self) -> u32;
    fn offset(&self) -> Self::Word;
    fn size(&self) -> Self::Word;
    fn align(&self) -> u32;

    // Provided methods
    fn architecture(&self) -> Architecture { ... }
    fn file_range(&self) -> (u64, u64) { ... }
    fn data<'data, R: ReadRef<'data>>(&self, file: R) -> Result<&'data [u8]> { ... }
}
Expand description

A trait for generic access to macho::FatArch32 and macho::FatArch64.

Required Associated Constants§

Required Associated Types§

Required Methods§

Source

fn cputype(&self) -> u32

Source

fn cpusubtype(&self) -> u32

Source

fn offset(&self) -> Self::Word

Source

fn size(&self) -> Self::Word

Source

fn align(&self) -> u32

Provided Methods§

Source

fn architecture(&self) -> Architecture

Source

fn file_range(&self) -> (u64, u64)

Source

fn data<'data, R: ReadRef<'data>>(&self, file: R) -> Result<&'data [u8]>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl FatArch for FatArch32

Source§

const MAGIC: u32 = macho::FAT_MAGIC

Source§

type Word = u32

Source§

impl FatArch for FatArch64

Source§

const MAGIC: u32 = macho::FAT_MAGIC_64

Source§

type Word = u64