Skip to main content

Container

Struct Container 

Source
pub struct Container<'a> { /* private fields */ }
Expand description

Parsed IFPS blob.

Borrows from the original byte slice — names, decls, and bytecode regions all reference the original buffer rather than allocating.

Implementations§

Source§

impl<'a> Container<'a>

Source

pub fn parse(bytes: &'a [u8]) -> Result<Container<'a>, Error>

Parses an IFPS blob from bytes.

§Errors

Returns whatever Header::parse or any of the per-table walkers (types, procs, vars) surface — see Error for the full set.

Source

pub fn header(&self) -> Header

Returns the parsed fixed header.

Source

pub fn bytes(&self) -> &'a [u8]

Returns the original blob bytes.

Source

pub fn types(&self) -> &[Type<'a>]

Returns the parsed type table in declaration order.

Source

pub fn procs(&self) -> &[Proc<'a>]

Returns the parsed proc table in declaration order.

Source

pub fn vars(&self) -> &[Var<'a>]

Returns the parsed var table in declaration order.

Source

pub fn main_proc(&self) -> Option<&Proc<'a>>

Returns the entry-point proc, or None when the blob has no main proc (MainProcNo == u32::MAX).

Source

pub fn display<'c>( &'c self, disasm: &'c ProcDisasm<'a>, ) -> DisasmDisplay<'a, 'c>

Wraps disasm in a DisasmDisplay bound to this container’s symbol tables, ready for format! / println!. Convenience over constructing the wrapper manually via DisasmDisplay::new.

Source

pub fn display_summary(&self) -> ContainerSummary<'a, '_>

Returns a ContainerSummary — single-line fmt::Display-ready triage view (IFPS build N — A types, B procs (X internal / Y external), C vars, main=…).

Source

pub fn disassemble( &self, proc_index: u32, ) -> Result<Option<ProcDisasm<'a>>, Error>

Disassembles the bytecode body of the proc at proc_index.

Returns Ok(None) when the requested proc is external (no bytecode body to walk). Returns Ok(Some(_)) with the fully decoded instruction stream when the proc is internal. The returned ProcDisasm borrows from the container’s IFPS blob.

§Errors

Trait Implementations§

Source§

impl<'a> Clone for Container<'a>

Source§

fn clone(&self) -> Container<'a>

Returns a duplicate 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<'a> Debug for Container<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Container<'a>

§

impl<'a> RefUnwindSafe for Container<'a>

§

impl<'a> Send for Container<'a>

§

impl<'a> Sync for Container<'a>

§

impl<'a> Unpin for Container<'a>

§

impl<'a> UnsafeUnpin for Container<'a>

§

impl<'a> UnwindSafe for Container<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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

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.