Struct BDFWriter

Source
pub struct BDFWriter { /* private fields */ }

Implementations§

Source§

impl BDFWriter

Source

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.

Source

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

Source

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

Source

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

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

Source

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

Sets the compression level for lzma compression

Source

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

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

Trait Implementations§

Source§

impl Debug for BDFWriter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.