pub struct StreamingJsonWriter<W: Write> { /* private fields */ }
Expand description
Streaming JSON writer optimized for allocation data
Implementations§
Source§impl<W: Write> StreamingJsonWriter<W>
impl<W: Write> StreamingJsonWriter<W>
Sourcepub fn new(writer: W) -> Result<Self, BinaryExportError>
pub fn new(writer: W) -> Result<Self, BinaryExportError>
Create a new streaming JSON writer with default configuration
Sourcepub fn with_config(
writer: W,
config: StreamingJsonWriterConfig,
) -> Result<Self, BinaryExportError>
pub fn with_config( writer: W, config: StreamingJsonWriterConfig, ) -> Result<Self, BinaryExportError>
Create a new streaming JSON writer with custom configuration
Sourcepub fn write_header(
&mut self,
total_allocations: u64,
) -> Result<(), BinaryExportError>
pub fn write_header( &mut self, total_allocations: u64, ) -> Result<(), BinaryExportError>
Start writing the JSON document with specified array name (for compatibility)
Sourcepub fn write_header_with_array_name(
&mut self,
_total_allocations: u64,
array_name: &str,
) -> Result<(), BinaryExportError>
pub fn write_header_with_array_name( &mut self, _total_allocations: u64, array_name: &str, ) -> Result<(), BinaryExportError>
Start writing the JSON document with custom array name
Sourcepub fn write_allocation_selective(
&mut self,
allocation: &PartialAllocationInfo,
requested_fields: &HashSet<AllocationField>,
) -> Result<(), BinaryExportError>
pub fn write_allocation_selective( &mut self, allocation: &PartialAllocationInfo, requested_fields: &HashSet<AllocationField>, ) -> Result<(), BinaryExportError>
Write a single allocation with selective fields
Sourcepub fn write_allocation_selective_with_options(
&mut self,
allocation: &PartialAllocationInfo,
requested_fields: &HashSet<AllocationField>,
options: &SelectiveSerializationOptions,
) -> Result<(), BinaryExportError>
pub fn write_allocation_selective_with_options( &mut self, allocation: &PartialAllocationInfo, requested_fields: &HashSet<AllocationField>, options: &SelectiveSerializationOptions, ) -> Result<(), BinaryExportError>
Write a single allocation with selective fields and custom serialization options
Sourcepub fn write_allocation_full(
&mut self,
allocation: &AllocationInfo,
) -> Result<(), BinaryExportError>
pub fn write_allocation_full( &mut self, allocation: &AllocationInfo, ) -> Result<(), BinaryExportError>
Write a full allocation (for compatibility)
Sourcepub fn write_memory_analysis_allocation(
&mut self,
allocation: &PartialAllocationInfo,
) -> Result<(), BinaryExportError>
pub fn write_memory_analysis_allocation( &mut self, allocation: &PartialAllocationInfo, ) -> Result<(), BinaryExportError>
Write allocation in memory_analysis.json format
Sourcepub fn write_performance_allocation(
&mut self,
allocation: &PartialAllocationInfo,
) -> Result<(), BinaryExportError>
pub fn write_performance_allocation( &mut self, allocation: &PartialAllocationInfo, ) -> Result<(), BinaryExportError>
Write allocation in performance.json format
Sourcepub fn write_unsafe_ffi_allocation(
&mut self,
allocation: &PartialAllocationInfo,
) -> Result<(), BinaryExportError>
pub fn write_unsafe_ffi_allocation( &mut self, allocation: &PartialAllocationInfo, ) -> Result<(), BinaryExportError>
Write allocation in unsafe_ffi.json format
Sourcepub fn write_complex_types_allocation(
&mut self,
allocation: &PartialAllocationInfo,
) -> Result<(), BinaryExportError>
pub fn write_complex_types_allocation( &mut self, allocation: &PartialAllocationInfo, ) -> Result<(), BinaryExportError>
Write allocation in complex_types.json format
Sourcepub fn write_lifecycle_event(
&mut self,
allocation: &PartialAllocationInfo,
event_type: &str,
) -> Result<(), BinaryExportError>
pub fn write_lifecycle_event( &mut self, allocation: &PartialAllocationInfo, event_type: &str, ) -> Result<(), BinaryExportError>
Write lifecycle event in lifetime.json format
Sourcepub fn write_allocation_batch(
&mut self,
allocations: &[PartialAllocationInfo],
requested_fields: &HashSet<AllocationField>,
) -> Result<(), BinaryExportError>
pub fn write_allocation_batch( &mut self, allocations: &[PartialAllocationInfo], requested_fields: &HashSet<AllocationField>, ) -> Result<(), BinaryExportError>
Write multiple allocations in batch for better performance
Sourcepub fn write_allocation_batch_with_options(
&mut self,
allocations: &[PartialAllocationInfo],
requested_fields: &HashSet<AllocationField>,
options: &SelectiveSerializationOptions,
) -> Result<(), BinaryExportError>
pub fn write_allocation_batch_with_options( &mut self, allocations: &[PartialAllocationInfo], requested_fields: &HashSet<AllocationField>, options: &SelectiveSerializationOptions, ) -> Result<(), BinaryExportError>
Write multiple allocations in batch with custom options
Sourcepub fn write_allocation_adaptive_chunked(
&mut self,
allocations: &[PartialAllocationInfo],
requested_fields: &HashSet<AllocationField>,
options: &SelectiveSerializationOptions,
) -> Result<(), BinaryExportError>
pub fn write_allocation_adaptive_chunked( &mut self, allocations: &[PartialAllocationInfo], requested_fields: &HashSet<AllocationField>, options: &SelectiveSerializationOptions, ) -> Result<(), BinaryExportError>
Write allocations with adaptive chunking for optimal performance
Sourcepub fn finalize(&mut self) -> Result<StreamingJsonStats, BinaryExportError>
pub fn finalize(&mut self) -> Result<StreamingJsonStats, BinaryExportError>
Finalize the JSON document and return statistics
Sourcepub fn get_stats(&self) -> &StreamingJsonStats
pub fn get_stats(&self) -> &StreamingJsonStats
Get current streaming statistics
Sourcepub fn flush(&mut self) -> Result<(), BinaryExportError>
pub fn flush(&mut self) -> Result<(), BinaryExportError>
Force flush the writer
Auto Trait Implementations§
impl<W> Freeze for StreamingJsonWriter<W>where
W: Freeze,
impl<W> RefUnwindSafe for StreamingJsonWriter<W>where
W: RefUnwindSafe,
impl<W> Send for StreamingJsonWriter<W>where
W: Send,
impl<W> Sync for StreamingJsonWriter<W>where
W: Sync,
impl<W> Unpin for StreamingJsonWriter<W>where
W: Unpin,
impl<W> UnwindSafe for StreamingJsonWriter<W>where
W: UnwindSafe,
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