Skip to main content

File

Struct File 

Source
pub struct File {
Show 20 fields pub rsrc_encrypted: bool, pub rsrc_compression: Algorithm, pub data_encrypted: bool, pub data_compression: Algorithm, pub file_name: String, pub file_code: FourCC, pub creator_code: FourCC, pub flags: FinderFlags, pub created_at: DateTime<Utc>, pub modified_at: DateTime<Utc>, pub rsrc_uncompressed_size: u32, pub data_uncompressed_size: u32, pub rsrc_compressed_size: u32, pub data_compressed_size: u32, pub rsrc_crc: u16, pub data_crc: u16, pub reserved: [u8; 6], pub header_crc: u16, pub payload_offset: u64, pub index: usize,
}

Fields§

§rsrc_encrypted: bool§rsrc_compression: Algorithm§data_encrypted: bool§data_compression: Algorithm§file_name: String

Name of the compressed file

§file_code: FourCC

Mac OS file type

§creator_code: FourCC

Mac OS file creator

§flags: FinderFlags

Attributes for file in Finder

§created_at: DateTime<Utc>

Creation date in classic Mac OS format (seconds since 1904)

§modified_at: DateTime<Utc>

Modification date in classic Mac OS format (seconds since 1904)

§rsrc_uncompressed_size: u32

Size of resource fork after decompression

§data_uncompressed_size: u32

Size of data fork after decompression

§rsrc_compressed_size: u32

Size of compressed resource fork data

§data_compressed_size: u32

Size of compressed data fork data

§rsrc_crc: u16

CRC-16 checksum for decompressed resource data

The CRC-16 configuration is CRC-16-IBM also known as CRC-16-ARC where the CRC of ASCII “123456789” is 0xbb3d.

§data_crc: u16

CRC-16 checksum for decompressed data fork data

The CRC-16 configuration is CRC-16-IBM also known as CRC-16-ARC where the CRC of ASCII “123456789” is 0xbb3d.

§reserved: [u8; 6]

Reserved for future use

§header_crc: u16

CRC-16 checksum of the file header without these last two bytes

The CRC-16 configuration is CRC-16-IBM also known as CRC-16-ARC where the CRC of ASCII “123456789” is 0xbb3d.

§payload_offset: u64§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 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 offset(&self, fork: Fork) -> u64

Source

pub fn uses_encryption(&self) -> bool

Trait Implementations§

Source§

impl BinRead for File

Source§

type Args<'__binrw_generated_args_lifetime> = FileBinReadArgs

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_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 Entry

Source§

fn from(val: File) -> Self

Converts to this type from the input type.
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.