[][src]Struct bdf::io::BDFWriter

pub struct BDFWriter { /* fields omitted */ }

Methods

impl BDFWriter[src]

pub fn new(inner: File, entry_count: u64, compress: bool) -> Self[src]

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.

pub fn start_threads(&self)[src]

Starts threads for parallel chunk compression

pub fn add_lookup_entry(&mut self, entry: HashEntry) -> Result<u32, Error>[src]

Adds an entry to the hash lookup table If the lookup table has already been written to the file, an error is returned

pub fn add_data_entry(&mut self, data_entry: DataEntry) -> Result<(), Error>[src]

Adds a data entry to the file. If the number of entries per chunk is reached, the data will be written to the file

pub fn finish(&mut self) -> Result<(), Error>[src]

Flushes the buffered chunk data and the writer to finish the file.

pub fn set_compression_level(&mut self, level: u32)[src]

Sets the compression level for lzma compression

pub fn set_entries_per_chunk(&mut self, number: u32) -> Result<(), Error>[src]

Changes the entries per chunk value. Returns an error if the metadata has already been written.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.