pub struct BDFWriter { /* private fields */ }
Implementations§
Source§impl BDFWriter
impl BDFWriter
Sourcepub fn new(inner: File, entry_count: u64, compress: bool) -> Self
pub fn new(inner: File, entry_count: u64, compress: bool) -> Self
Creates a new BDFWriter.
The number for entry_count
should be the total number of entries
This is required since the META chunk containing the information is the
first chunk to be written.
The number of entries can be used in tools that provide a progress
bar for how many entries were read.
If the compress
parameter is true, each data chunk will be compressed
using lzma with a default level of 1.
Sourcepub fn add_lookup_entry(&mut self, entry: HashEntry) -> Result<u32, Error>
pub fn add_lookup_entry(&mut self, entry: HashEntry) -> Result<u32, Error>
Adds an entry to the hash lookup table If the lookup table has already been written to the file, an error is returned
Sourcepub fn add_data_entry(&mut self, data_entry: DataEntry) -> Result<(), Error>
pub fn add_data_entry(&mut self, data_entry: DataEntry) -> Result<(), Error>
Adds a data entry to the file. If the number of entries per chunk is reached, the data will be written to the file
Sourcepub fn finish(&mut self) -> Result<(), Error>
pub fn finish(&mut self) -> Result<(), Error>
Flushes the buffered chunk data and the writer to finish the file.
Sourcepub fn set_compression_level(&mut self, level: u32)
pub fn set_compression_level(&mut self, level: u32)
Sets the compression level for lzma compression
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BDFWriter
impl RefUnwindSafe for BDFWriter
impl Send for BDFWriter
impl Sync for BDFWriter
impl Unpin for BDFWriter
impl UnwindSafe for BDFWriter
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