Struct goblin::mach::header::Header

source ·
#[repr(C)]
pub struct Header { pub magic: u32, pub cputype: u32, pub cpusubtype: u32, pub filetype: u32, pub ncmds: usize, pub sizeofcmds: u32, pub flags: u32, pub reserved: u32, }
Expand description

Generic sized header

Fields§

§magic: u32§cputype: u32§cpusubtype: u32§filetype: u32

type of file

§ncmds: usize

number of load commands

§sizeofcmds: u32

the size of all the load commands

§flags: u32

flags

§reserved: u32

Implementations§

source§

impl Header

source

pub fn new(ctx: Ctx) -> Self

source

pub fn cputype(&self) -> CpuType

Returns the cpu type

source

pub fn cpusubtype(&self) -> CpuSubType

Returns the cpu subtype with the capabilities removed

source

pub fn cpu_caps(&self) -> u32

Returns the capabilities of the CPU

Trait Implementations§

source§

impl Clone for Header

source§

fn clone(&self) -> Header

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Header

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Header

source§

fn default() -> Header

Returns the “default value” for a type. Read more
source§

impl From<Header> for Header32

source§

fn from(header: Header) -> Self

Converts to this type from the input type.
source§

impl From<Header> for Header64

source§

fn from(header: Header) -> Self

Converts to this type from the input type.
source§

impl From<Header32> for Header

source§

fn from(header: Header32) -> Self

Converts to this type from the input type.
source§

impl From<Header64> for Header

source§

fn from(header: Header64) -> Self

Converts to this type from the input type.
source§

impl IntoCtx<Ctx> for Header

source§

fn into_ctx(self, bytes: &mut [u8], ctx: Ctx)

source§

impl SizeWith<Container> for Header

source§

fn size_with(container: &Container) -> usize

source§

impl SizeWith<Ctx> for Header

source§

fn size_with(container: &Ctx) -> usize

source§

impl<'a> TryFromCtx<'a, Ctx> for Header

§

type Error = Error

source§

fn try_from_ctx(bytes: &'a [u8], _: Ctx) -> Result<(Self, usize)>

source§

impl TryIntoCtx<Ctx> for Header

§

type Error = Error

source§

fn try_into_ctx(self, bytes: &mut [u8], ctx: Ctx) -> Result<usize>

source§

impl Copy for Header

Auto Trait Implementations§

§

impl Freeze for Header

§

impl RefUnwindSafe for Header

§

impl Send for Header

§

impl Sync for Header

§

impl Unpin for Header

§

impl UnwindSafe for Header

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.