#[non_exhaustive]pub struct FileHeader {Show 14 fields
pub block: BlockHeader,
pub pack_size: u64,
pub unp_size: u64,
pub host_os: u8,
pub file_crc: u32,
pub file_time: u32,
pub unp_ver: u8,
pub method: u8,
pub name: Vec<u8>,
pub attr: u32,
pub salt: Option<[u8; 8]>,
pub file_comment: Vec<u8>,
pub ext_time: Vec<u8>,
pub packed_range: Range<usize>,
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.block: BlockHeader§pack_size: u64§unp_size: u64§host_os: u8§file_crc: u32§file_time: u32§unp_ver: u8§method: u8§name: Vec<u8>§attr: u32§salt: Option<[u8; 8]>§file_comment: Vec<u8>§ext_time: Vec<u8>§packed_range: Range<usize>Implementations§
Source§impl FileHeader
impl FileHeader
pub fn name_bytes(&self) -> &[u8] ⓘ
Sourcepub fn name_lossy(&self) -> String
pub fn name_lossy(&self) -> String
Returns the file name with invalid UTF-8 replaced for display only.
Use Self::name_bytes when exact archive bytes matter.
pub fn is_split_before(&self) -> bool
pub fn is_split_after(&self) -> bool
pub fn is_encrypted(&self) -> bool
pub fn is_solid(&self) -> bool
pub fn is_directory(&self) -> bool
pub fn has_ext_time(&self) -> bool
pub fn has_file_comment(&self) -> bool
pub fn file_comment(&self) -> Result<Option<Vec<u8>>>
pub fn is_stored(&self) -> bool
pub fn packed_data(&self, archive: &Archive) -> Result<Vec<u8>>
pub fn write_packed_data( &self, archive: &Archive, out: &mut impl Write, ) -> Result<()>
pub fn verify_crc32(&self, data: &[u8]) -> Result<()>
pub fn metadata(&self) -> ExtractedEntryMeta
pub fn write_to( &self, archive: &Archive, password: Option<&[u8]>, out: &mut impl Write, ) -> Result<()>
Trait Implementations§
Source§impl Clone for FileHeader
impl Clone for FileHeader
Source§fn clone(&self) -> FileHeader
fn clone(&self) -> FileHeader
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileHeader
impl Debug for FileHeader
Source§impl PartialEq for FileHeader
impl PartialEq for FileHeader
Source§fn eq(&self, other: &FileHeader) -> bool
fn eq(&self, other: &FileHeader) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for FileHeader
impl StructuralPartialEq for FileHeader
Auto Trait Implementations§
impl Freeze for FileHeader
impl RefUnwindSafe for FileHeader
impl Send for FileHeader
impl Sync for FileHeader
impl Unpin for FileHeader
impl UnsafeUnpin for FileHeader
impl UnwindSafe for FileHeader
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