BinaryParser

Struct BinaryParser 

Source
pub struct BinaryParser;
Expand description

Binary parser for optimized file conversion

Implementations§

Source§

impl BinaryParser

Source

pub fn to_standard_json_files<P: AsRef<Path>>( binary_path: P, base_name: &str, ) -> Result<(), BinaryExportError>

Convert binary file to standard JSON files using optimized approach

Source

pub fn load_allocations<P: AsRef<Path>>( binary_path: P, ) -> Result<Vec<AllocationInfo>, BinaryExportError>

Load allocations from binary file

Source

pub fn load_allocations_with_recovery<P: AsRef<Path>>( binary_path: P, ) -> Result<Vec<AllocationInfo>, BinaryExportError>

Load allocations with enhanced error recovery

fix “failed to fill whole buffer”

Source

pub fn to_json<P: AsRef<Path>>( binary_path: P, json_path: P, ) -> Result<(), BinaryExportError>

Convert binary file to single JSON format (legacy compatibility) 🔥 FIXED: Memory overflow issue - now uses streaming instead of loading all data at once

Source

pub fn to_html<P: AsRef<Path>>( binary_path: P, html_path: P, ) -> Result<(), BinaryExportError>

Convert binary file to HTML format (legacy compatibility)

Source

pub fn parse_user_binary_to_json<P: AsRef<Path>>( binary_path: P, base_name: &str, ) -> Result<(), BinaryExportError>

Parse user binary to JSON using BinaryReader for consistency and performance Now uses the same BinaryReader approach as full binary parsing for consistent performance

Source

pub fn parse_full_binary_to_json<P: AsRef<Path>>( binary_path: P, base_name: &str, ) -> Result<(), BinaryExportError>

Parse full binary to JSON using ultra-fast direct approach

One-Stop Solution: Directly use the optimized generate_*_json method to avoid SelectiveJsonExporter’s I/O errors.

Core Optimizations:

  • Use load_allocations with improved error handling
  • Directly call optimized generate_*_json method (avoid complex SelectiveJsonExporter)
  • Parallel generate 5 JSON files
  • aim: <300ms, no null fields, JSON format consistent
Source

pub fn parse_full_binary_to_json_with_existing_optimizations<P: AsRef<Path>>( binary_path: P, base_name: &str, ) -> Result<(), BinaryExportError>

Ultra-fast binary to JSON conversion using existing optimizations

This method provides the same ultra-fast performance as v5-draft

Source

pub fn generate_memory_analysis_json( allocations: &[AllocationInfo], output_path: &Path, ) -> Result<(), BinaryExportError>

Generate memory analysis JSON directly (fast path)

Source

pub fn generate_lifetime_analysis_json( allocations: &[AllocationInfo], output_path: &Path, ) -> Result<(), BinaryExportError>

Generate lifetime analysis JSON directly (fast path)

Source

pub fn generate_performance_analysis_json( allocations: &[AllocationInfo], output_path: &Path, ) -> Result<(), BinaryExportError>

Generate performance analysis JSON directly (fast path)

Source

pub fn generate_unsafe_ffi_analysis_json( allocations: &[AllocationInfo], output_path: &Path, ) -> Result<(), BinaryExportError>

Generate unsafe FFI analysis JSON directly (fast path)

Source

pub fn generate_complex_types_analysis_json( allocations: &[AllocationInfo], output_path: &Path, ) -> Result<(), BinaryExportError>

Generate complex types analysis JSON directly (fast path)

Source

pub fn parse_binary_to_json_with_index<P: AsRef<Path>>( binary_path: P, base_name: &str, ) -> Result<(), BinaryExportError>

[New Interface] Parse binary to JSON using BinaryIndex for maximum performance

This is the core high-performance interface that uses BinaryIndex for direct data access, avoiding the overhead of loading all allocations into memory.

Auto Trait Implementations§

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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