pub struct Header {Show 15 fields
pub magic: [u8; 4],
pub version: u32,
pub block_size: u32,
pub index_offset: u64,
pub parent_paths: Vec<String>,
pub dictionary_offset: Option<u64>,
pub dictionary_length: Option<u32>,
pub metadata_offset: Option<u64>,
pub metadata_length: Option<u32>,
pub signature_offset: Option<u64>,
pub signature_length: Option<u32>,
pub encryption: Option<KeyDerivationParams>,
pub compression: CompressionType,
pub features: FeatureFlags,
pub cdc_params: Option<(u32, u32, u32)>,
}Expand description
On-disk archive file header containing format metadata.
Fields§
§magic: [u8; 4]Magic bytes identifying the file as a Hexz archive.
version: u32Format version number for compatibility checks.
block_size: u32Block size in bytes used for data segmentation.
index_offset: u64Byte offset of the master index within the archive.
parent_paths: Vec<String>Paths to parent archives for thin (incremental) archives.
dictionary_offset: Option<u64>Byte offset of the compression dictionary, if present.
dictionary_length: Option<u32>Length in bytes of the compression dictionary, if present.
metadata_offset: Option<u64>Byte offset of the metadata section, if present.
metadata_length: Option<u32>Length in bytes of the metadata section, if present.
signature_offset: Option<u64>Byte offset of the digital signature, if present.
signature_length: Option<u32>Length in bytes of the digital signature, if present.
encryption: Option<KeyDerivationParams>Key derivation parameters when the archive is encrypted.
compression: CompressionTypeCompression algorithm used for data blocks.
features: FeatureFlagsFeature flags indicating enabled capabilities.
cdc_params: Option<(u32, u32, u32)>Content-defined chunking parameters used for this archive.
(fingerprint_bits, min_chunk, max_chunk)
Implementations§
Source§impl Header
impl Header
Sourcepub fn read_from<R: Read>(reader: &mut R) -> Result<Self>
pub fn read_from<R: Read>(reader: &mut R) -> Result<Self>
Read and deserialize a header from a std::io::Read source.
Sourcepub fn read_from_backend(backend: &dyn StorageBackend) -> Result<Self>
pub fn read_from_backend(backend: &dyn StorageBackend) -> Result<Self>
Read a header from a StorageBackend at offset 0.
Sourcepub fn load_dictionary(
&self,
backend: &dyn StorageBackend,
) -> Result<Option<Vec<u8>>>
pub fn load_dictionary( &self, backend: &dyn StorageBackend, ) -> Result<Option<Vec<u8>>>
Load the compression dictionary from the backend, if present.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Header
impl<'de> Deserialize<'de> for Header
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Header
impl StructuralPartialEq for Header
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnsafeUnpin for Header
impl UnwindSafe for Header
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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>
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