pub struct BinaryParser;
Expand description
Binary parser for optimized file conversion
Implementations§
Source§impl BinaryParser
impl BinaryParser
Sourcepub fn to_standard_json_files<P: AsRef<Path>>(
binary_path: P,
base_name: &str,
) -> Result<(), BinaryExportError>
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
Sourcepub fn load_allocations<P: AsRef<Path>>(
binary_path: P,
) -> Result<Vec<AllocationInfo>, BinaryExportError>
pub fn load_allocations<P: AsRef<Path>>( binary_path: P, ) -> Result<Vec<AllocationInfo>, BinaryExportError>
Load allocations from binary file
Sourcepub fn load_allocations_with_recovery<P: AsRef<Path>>(
binary_path: P,
) -> Result<Vec<AllocationInfo>, BinaryExportError>
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”
Sourcepub fn to_json<P: AsRef<Path>>(
binary_path: P,
json_path: P,
) -> Result<(), BinaryExportError>
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
Sourcepub fn to_html<P: AsRef<Path>>(
binary_path: P,
html_path: P,
) -> Result<(), BinaryExportError>
pub fn to_html<P: AsRef<Path>>( binary_path: P, html_path: P, ) -> Result<(), BinaryExportError>
Convert binary file to HTML format (legacy compatibility)
Sourcepub fn parse_user_binary_to_json<P: AsRef<Path>>(
binary_path: P,
base_name: &str,
) -> Result<(), BinaryExportError>
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
Sourcepub fn parse_full_binary_to_json<P: AsRef<Path>>(
binary_path: P,
base_name: &str,
) -> Result<(), BinaryExportError>
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
Sourcepub fn parse_full_binary_to_json_with_existing_optimizations<P: AsRef<Path>>(
binary_path: P,
base_name: &str,
) -> Result<(), BinaryExportError>
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
Sourcepub fn generate_memory_analysis_json(
allocations: &[AllocationInfo],
output_path: &Path,
) -> Result<(), BinaryExportError>
pub fn generate_memory_analysis_json( allocations: &[AllocationInfo], output_path: &Path, ) -> Result<(), BinaryExportError>
Generate memory analysis JSON directly (fast path)
Sourcepub fn generate_lifetime_analysis_json(
allocations: &[AllocationInfo],
output_path: &Path,
) -> Result<(), BinaryExportError>
pub fn generate_lifetime_analysis_json( allocations: &[AllocationInfo], output_path: &Path, ) -> Result<(), BinaryExportError>
Generate lifetime analysis JSON directly (fast path)
Sourcepub fn generate_performance_analysis_json(
allocations: &[AllocationInfo],
output_path: &Path,
) -> Result<(), BinaryExportError>
pub fn generate_performance_analysis_json( allocations: &[AllocationInfo], output_path: &Path, ) -> Result<(), BinaryExportError>
Generate performance analysis JSON directly (fast path)
Sourcepub fn generate_unsafe_ffi_analysis_json(
allocations: &[AllocationInfo],
output_path: &Path,
) -> Result<(), BinaryExportError>
pub fn generate_unsafe_ffi_analysis_json( allocations: &[AllocationInfo], output_path: &Path, ) -> Result<(), BinaryExportError>
Generate unsafe FFI analysis JSON directly (fast path)
Sourcepub fn generate_complex_types_analysis_json(
allocations: &[AllocationInfo],
output_path: &Path,
) -> Result<(), BinaryExportError>
pub fn generate_complex_types_analysis_json( allocations: &[AllocationInfo], output_path: &Path, ) -> Result<(), BinaryExportError>
Generate complex types analysis JSON directly (fast path)
Sourcepub fn parse_binary_to_json_with_index<P: AsRef<Path>>(
binary_path: P,
base_name: &str,
) -> Result<(), BinaryExportError>
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§
impl Freeze for BinaryParser
impl RefUnwindSafe for BinaryParser
impl Send for BinaryParser
impl Sync for BinaryParser
impl Unpin for BinaryParser
impl UnwindSafe for BinaryParser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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