Struct Header

Source
pub struct Header {
Show 16 fields pub class: Class, pub byte_order: ByteOrder, pub os_abi: OsAbi, pub abi_version: u8, pub kind: FileKind, pub machine: Machine, pub flags: u32, pub entry_point: u64, pub program_header_offset: u64, pub segment_len: u16, pub num_segments: u16, pub section_header_offset: u64, pub section_len: u16, pub num_sections: u16, pub section_names_index: u16, pub len: u16,
}
Expand description

ELF header.

Fields§

§class: Class

Bitness.

§byte_order: ByteOrder

Data format.

§os_abi: OsAbi

Operating system ABI.

§abi_version: u8

ABI version

§kind: FileKind

File type.

§machine: Machine

Architecture.

§flags: u32

Architecture-specific flags.

Use ArmFlags to query ARM-specific flags.

§entry_point: u64

Program entry point.

§program_header_offset: u64

Program header (the list of segments) offset within the file.

§segment_len: u16

The length of each segment’s metadata entry.

§num_segments: u16

The number of segments.

§section_header_offset: u64

Section header (the list of sections) offset within the file.

§section_len: u16

The length of each section’s metadata entry.

§num_sections: u16

The number of sections.

§section_names_index: u16

The index of the section in the section header that stores the names of sections.

§len: u16

The length of the ELF header.

Implementations§

Source§

impl Header

Source

pub fn read<R: ElfRead>(reader: &mut R) -> Result<Self, Error>

Read header from reader.

Source

pub fn write<W: ElfWrite>(&self, writer: &mut W) -> Result<(), Error>

Write header to writer.

The header is validated before writing.

Source

pub fn check(&self) -> Result<(), Error>

Validate the header.

Source

pub const fn program_header_len(&self) -> u64

The size in bytes of the program header (the list of segments).

Source

pub const fn section_header_len(&self) -> u64

The size in bytes of the section header (the list of sections).

Trait Implementations§

Source§

impl Debug for Header

Source§

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

Formats the value using the given formatter. Read more

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.