pub struct BinaryWriter { /* private fields */ }
Expand description
Binary writer for allocation records using buffered I/O
Implementations§
Source§impl BinaryWriter
impl BinaryWriter
Sourcepub fn new<P: AsRef<Path>>(path: P) -> Result<Self, BinaryExportError>
pub fn new<P: AsRef<Path>>(path: P) -> Result<Self, BinaryExportError>
Create new binary writer for the specified file path with default config
Sourcepub fn new_with_config<P: AsRef<Path>>(
path: P,
config: &BinaryExportConfig,
) -> Result<Self, BinaryExportError>
pub fn new_with_config<P: AsRef<Path>>( path: P, config: &BinaryExportConfig, ) -> Result<Self, BinaryExportError>
Create new binary writer with custom configuration
Sourcepub fn build_string_table(
&mut self,
allocations: &[AllocationInfo],
) -> Result<(), BinaryExportError>
pub fn build_string_table( &mut self, allocations: &[AllocationInfo], ) -> Result<(), BinaryExportError>
Build string table from allocation data for optimization
Sourcepub fn write_header(&mut self, count: u32) -> Result<(), BinaryExportError>
pub fn write_header(&mut self, count: u32) -> Result<(), BinaryExportError>
Write file header with allocation count and optional string table (legacy compatibility)
Sourcepub fn write_enhanced_header(
&mut self,
total_count: u32,
export_mode: BinaryExportMode,
user_count: u16,
system_count: u16,
) -> Result<(), BinaryExportError>
pub fn write_enhanced_header( &mut self, total_count: u32, export_mode: BinaryExportMode, user_count: u16, system_count: u16, ) -> Result<(), BinaryExportError>
Write enhanced file header with export mode and allocation counts
Sourcepub fn write_allocation(
&mut self,
alloc: &AllocationInfo,
) -> Result<(), BinaryExportError>
pub fn write_allocation( &mut self, alloc: &AllocationInfo, ) -> Result<(), BinaryExportError>
Write single allocation record in TLV format
Sourcepub fn write_advanced_metrics_segment(
&mut self,
allocations: &[AllocationInfo],
) -> Result<(), BinaryExportError>
pub fn write_advanced_metrics_segment( &mut self, allocations: &[AllocationInfo], ) -> Result<(), BinaryExportError>
Write advanced metrics segment if enabled in config
Sourcepub fn finish(self) -> Result<(), BinaryExportError>
pub fn finish(self) -> Result<(), BinaryExportError>
Finish writing and flush all data to disk
Auto Trait Implementations§
impl Freeze for BinaryWriter
impl RefUnwindSafe for BinaryWriter
impl Send for BinaryWriter
impl Sync for BinaryWriter
impl Unpin for BinaryWriter
impl UnwindSafe for BinaryWriter
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
Mutably borrows from an owned value. Read more
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>
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 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>
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