Skip to main content

File

Struct File 

Source
pub struct File {
Show 35 fields pub version: u8, pub unknown1: u8, pub header_len: u16, pub unknown2: u8, pub flags: EntryFlags, pub creation_date: DateTime<Utc>, pub modification_date: DateTime<Utc>, pub previous_entry_offset: u32, pub next_entry_offset: u32, pub directory_entry_offset: u32, pub file_name_len: u16, pub header_crc: u16, pub data_uncompressed_size: u32, pub data_compressed_size: u32, pub data_crc: u16, pub unknown: u16, pub data_compression: Algorithm, pub datakey: Vec<u8>, pub file_name: String, pub comment_len: u16, pub unknown9: u16, pub comment: String, pub unknown10: u8, pub additional_flags: AdditionalFlags, pub unknown_checksum: u16, pub file_code: FourCC, pub creator_code: FourCC, pub finder_flags: FinderFlags, pub rsrc_uncompressed_size: u32, pub rsrc_compressed_size: u32, pub rsrc_crc: u16, pub rsrc_unknown: u16, pub rsrc_compression: Algorithm, pub res_key: Vec<u8>, pub index: usize, /* private fields */
}
Expand description

A file entry in v5 archives

Fields§

§version: u8§unknown1: u8§header_len: u16§unknown2: u8§flags: EntryFlags§creation_date: DateTime<Utc>§modification_date: DateTime<Utc>§previous_entry_offset: u32§next_entry_offset: u32§directory_entry_offset: u32§file_name_len: u16§header_crc: u16§data_uncompressed_size: u32§data_compressed_size: u32§data_crc: u16§unknown: u16§data_compression: Algorithm§datakey: Vec<u8>§file_name: String§comment_len: u16§unknown9: u16§comment: String§unknown10: u8§additional_flags: AdditionalFlags§unknown_checksum: u16§file_code: FourCC§creator_code: FourCC§finder_flags: FinderFlags§rsrc_uncompressed_size: u32§rsrc_compressed_size: u32§rsrc_crc: u16§rsrc_unknown: u16§rsrc_compression: Algorithm§res_key: Vec<u8>§index: usize

Index of the file entry determine by counting previous file entries in depth-first search order

Implementations§

Source§

impl File

Source

pub fn offset(&self, fork: Fork) -> u64

Source

pub fn uncompressed_size(&self, fork: Fork) -> usize

Source

pub fn compressed_size(&self, fork: Fork) -> usize

Source

pub fn compression_method(&self, fork: Fork) -> Algorithm

Source

pub fn checksum(&self, fork: Fork) -> u16

Source

pub fn encrypted(&self, fork: Fork) -> bool

Source

pub fn uses_encryption(&self) -> bool

Trait Implementations§

Source§

impl BinRead for File

Source§

type Args<'__binrw_generated_args_lifetime> = ()

The type used for the args parameter of read_args() and read_options(). Read more
Source§

fn read_options<R: Read + Seek>( __binrw_generated_var_reader: &mut R, __binrw_generated_var_endian: Endian, __binrw_generated_var_arguments: Self::Args<'_>, ) -> BinResult<Self>

Read Self from the reader using the given Endian and arguments. Read more
Source§

fn read<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self: ReadEndian, Self::Args<'a>: for<'a> Required,

Read Self from the reader using default arguments. Read more
Source§

fn read_be<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self::Args<'a>: for<'a> Required,

Read Self from the reader using default arguments and assuming big-endian byte order. Read more
Source§

fn read_le<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self::Args<'a>: for<'a> Required,

Read Self from the reader using default arguments and assuming little-endian byte order. Read more
Source§

fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self::Args<'a>: for<'a> Required,

Read T from the reader assuming native-endian byte order. Read more
Source§

fn read_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
where R: Read + Seek, Self: ReadEndian,

Read Self from the reader using the given arguments. Read more
Source§

fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
where R: Read + Seek,

Read Self from the reader, assuming big-endian byte order, using the given arguments. Read more
Source§

fn read_le_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
where R: Read + Seek,

Read Self from the reader, assuming little-endian byte order, using the given arguments. Read more
Source§

fn read_ne_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
where R: Read + Seek,

Read T from the reader, assuming native-endian byte order, using the given arguments. Read more
Source§

impl Clone for File

Source§

fn clone(&self) -> File

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for File

Source§

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

Formats the value using the given formatter. Read more
Source§

impl From<File> for File

Source§

fn from(value: File) -> Self

Converts to this type from the input type.
Source§

impl ReadEndian for File

Source§

const ENDIAN: EndianKind

The endianness of the type.
Source§

impl ReadableEntry for File

Source§

fn algorithm(&self, fork: Fork) -> Algorithm

Algorithm used to compress the entry’s data or resource fork
Source§

fn compressed_size(&self, fork: Fork) -> usize

Amount of bytes occupied by the specified fork
Source§

fn uncompressed_size(&self, fork: Fork) -> usize

Size of the fork in bytes after decompression
Source§

fn encrypted(&self, fork: Fork) -> bool

Source§

fn offset(&self, fork: Fork) -> u64

Offset from start of the archive header to beginning of the compressed data
Source§

fn checksum(&self, fork: Fork) -> u16

Checksum of the uncompressed data

Auto Trait Implementations§

§

impl Freeze for File

§

impl RefUnwindSafe for File

§

impl Send for File

§

impl Sync for File

§

impl Unpin for File

§

impl UnwindSafe for File

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.