ObjReader

Struct ObjReader 

Source
pub struct ObjReader<R> { /* private fields */ }
Expand description

COFF 对象文件 (.obj) 结构,惰性读取器

Implementations§

Source§

impl<R> ObjReader<R>

Source

pub fn new(reader: R) -> Self

Source§

impl<W: Read + Seek> ObjReader<W>

Source

pub fn read_object(self) -> GaiaDiagnostics<CoffObject>

读取完整的 COFF 对象(惰性读取,会缓存结果)

Source

pub fn view(&mut self) -> Result<CoffInfo, GaiaError>

查看 COFF 对象文件信息

Source§

impl ObjReader<File>

Source

pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self, GaiaError>

从文件创建 COFF 读取器

Trait Implementations§

Source§

impl<W: Read + Seek> CoffReader<W> for ObjReader<W>

Source§

fn get_viewer(&mut self) -> &mut BinaryReader<W, LittleEndian>

获取二进制读取器的可变引用
Source§

fn add_diagnostics(&mut self, error: impl Into<GaiaError>)

获取诊断信息的可变引用
Source§

fn get_cached_section_headers(&self) -> Option<&Vec<SectionHeader>>

获取缓存的节头信息
Source§

fn set_cached_section_headers(&mut self, headers: Vec<SectionHeader>)

设置缓存的节头信息
Source§

fn read_header_once(&mut self) -> Result<&CoffHeader, GaiaError>

读取 COFF 头部信息(通用实现)
Source§

fn read_object_once(&mut self) -> Result<&CoffObject, GaiaError>

强制读取完整的 COFF 对象,并缓存结果
Source§

fn read_header_force(&mut self) -> Result<CoffHeader, GaiaError>

强制读取 COFF 头部(通用实现)
Source§

fn read_section_headers(&mut self) -> Result<Vec<SectionHeader>, GaiaError>

读取节头信息(通用实现)
Source§

fn read_section_from_header( &mut self, header: &SectionHeader, ) -> Result<CoffSection, GaiaError>

从节头读取节数据(通用实现)
Source§

fn read_symbols(&mut self) -> Result<Vec<CoffSymbol>, GaiaError>

读取符号表(通用实现)
Source§

fn create_coff_info(&mut self) -> Result<CoffInfo, GaiaError>

创建 COFF 信息视图(通用实现)
Source§

fn read_object_force(&mut self) -> Result<CoffObject, GaiaError>

强制读取完整的 COFF 对象
Source§

impl<R: Debug> Debug for ObjReader<R>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<R> Freeze for ObjReader<R>
where R: Freeze,

§

impl<R> !RefUnwindSafe for ObjReader<R>

§

impl<R> Send for ObjReader<R>
where R: Send,

§

impl<R> Sync for ObjReader<R>
where R: Sync,

§

impl<R> Unpin for ObjReader<R>
where R: Unpin,

§

impl<R> !UnwindSafe for ObjReader<R>

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

impl<T> ErasedDestructor for T
where T: 'static,