xabc_lib::header

Struct Header

Source
pub struct Header { /* private fields */ }
Expand description

ABC file header 12*4 + 8 + 4 = 60

Implementations§

Source§

impl Header

Source

pub fn magic(&self) -> [u8; 8]

文件头魔数,值必须是’P’ ‘A’ ‘N’ ‘D’ ‘A’ ‘\0’ ‘\0’ ‘\0’。

Source

pub fn checksum(&self) -> [u8; 4]

字节码文件除文件头魔数和本校验字段之外的内容的 adler32 校验和。

Source

pub fn version(&self) -> [u8; 4]

字节码文件的版本号 (Version) 。

Source

pub fn file_size(&self) -> uint32_t

字节码文件的大小,以字节为单位。

Source

pub fn foreign_off(&self) -> uint32_t

一个偏移量,指向外部区域。外部区域中仅包含类型为 ForeignClass 或ForeignMethod的元素。foreign_off指向该区域的第一个元素。

Source

pub fn foreign_size(&self) -> uint32_t

外部区域的大小,以字节为单位。

Source

pub fn classes_size(&self) -> uint32_t

ClassIndex结构中元素的数量,即文件中定义的Class的数量。

Source

pub fn class_idx_off(&self) -> uint32_t

一个偏移量,指向ClassIndex。

Source

pub fn num_lnps(&self) -> uint32_t

LineNumberProgramIndex结构中元素的数量,即文件中定义的Line number program的数量。

Source

pub fn lnp_idx_off(&self) -> uint32_t

一个偏移量,指向LineNumberProgramIndex。

Source

pub fn literalarrays_size(&self) -> uint32_t

LiteralArrayIndex 的数量

Source

pub fn literalarray_idx_off(&self) -> uint32_t

指向 LiteralArrayIndex 的偏移量

Source

pub fn region_size(&self) -> uint32_t

RegionIndex 的数量

Source

pub fn region_off(&self) -> uint32_t

一个偏移量,指向第一个 RegionIndex

Trait Implementations§

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 Display for Header

Source§

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

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

impl<'a> TryFromCtx<'a, Endian> for Header
where Header: 'a,

Source§

type Error = Error

Source§

fn try_from_ctx( src: &'a [u8], ctx: Endian, ) -> Result<(Self, usize), Self::Error>

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more