Enum BlockFlags

Source
#[repr(u32)]
pub enum BlockFlags { DontCompress = 1, BlockAlign = 2, DontFragment = 4, DontDeduplicate = 8, IgnoreSparse = 16, DontHash = 32, }
Expand description

Flags to fine-tune how an entry is added to the archive.

These valued can be ORed together and passed in the flags field of a Source object.

Variants§

§

DontCompress = 1

Don’t compress file data.

By default, files are compressed, and the compressed version is stored in the archive if it is smaller than the uncompressed version. Setting this flag will force the file to be stored uncompressed.

§

BlockAlign = 2

Align the file data to device blocks.

If set, padding will be added before and after this file’s data blocks so that it is aligned to the blocks of the underlying disk.

§

DontFragment = 4

Store the tail of the file in a regular data block rather than a fragment block.

The compressed content of a file to be written to an archive is split into equally-sized blocks and stored as “data blocks”. The final chunk is usually smaller than the rest, so these final chunks are collected from multiple files are collected and stored together in separate “fragment blocks” as an optimization. If there is a reason for the entire file’s contents to be stored together, fragmentation can be disabled using this flag.

§

DontDeduplicate = 8

Don’t deduplicated data blocks for this file.

If two files contain an identical data block, the block will be stored only once and both files’ block indices will point to this single block. The user can force all blocks of a file to be stored by setting this flag.

§

IgnoreSparse = 16

Don’t elide sparse blocks.

If a block of a file contains only zeros, it will not be stored at all and the file’s block index will mark that the block is all-zero. This behavior can be disabled so that a zero block will be written by setting this flag.

§

DontHash = 32

Don’t compute block checksums for this file.

Each data block is checksummed to verify data integrity unless this flag is set.

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.
Source§

impl<T> Erased for T