Skip to main content

SourceFileSnapshot

Struct SourceFileSnapshot 

Source
pub struct SourceFileSnapshot {
Show 20 fields pub name: String, pub name_utf16: Vec<u16>, pub cnid: u32, pub parent_cnid: u32, pub flags: u16, pub finder_info: [u8; 16], pub extended_finder_info: [u8; 16], pub bsd_info: [u8; 16], pub create_date: u32, pub content_mod_date: u32, pub attribute_mod_date: u32, pub access_date: u32, pub backup_date: u32, pub text_encoding: u32, pub data_fork_raw: [u8; 80], pub rsrc_fork_raw: [u8; 80], pub data_fork_size: u64, pub rsrc_fork_size: u64, pub is_inode: bool, pub inode_num: Option<u32>, /* private fields */
}
Expand description

Per-file metadata captured from a kHFSPlusFileRecord.

Fields§

§name: String§name_utf16: Vec<u16>§cnid: u32

Source CNID (fileID).

§parent_cnid: u32§flags: u16§finder_info: [u8; 16]

userInfo — 16 bytes of FileInfo (FInfo). fdType at byte 0 and fdCreator at byte 4 are the type/creator codes; fdFlags at byte 8 is the Finder flags word (0x8000 = kIsAlias).

§extended_finder_info: [u8; 16]

finderInfo — 16 bytes of ExtendedFileInfo (FXInfo).

§bsd_info: [u8; 16]

permissions — 16 bytes of HFSPlusBSDInfo (zeros on most volumes).

§create_date: u32§content_mod_date: u32§attribute_mod_date: u32§access_date: u32§backup_date: u32§text_encoding: u32§data_fork_raw: [u8; 80]

Raw 80-byte HFSPlusForkData for the data fork (8 inline extents + logical/total/clump). Resolved into a streaming reader via HfsPlusFilesystem::fork_stream_reader at clone time so the bytes never have to materialise in RAM.

§rsrc_fork_raw: [u8; 80]

Raw 80-byte HFSPlusForkData for the resource fork.

§data_fork_size: u64

Logical data-fork size in bytes (mirror of bytes 0..8 of data_fork_raw, broken out for convenience).

§rsrc_fork_size: u64

Logical resource-fork size in bytes.

§is_inode: bool

true for files that live under the source’s HFS+ Private Data directory whose name parses as iNode<N> — i.e. file-hardlink inodes. Replay must emit them through create_hardlink_inode rather than as ordinary files in the user-visible tree, and the hardlink stubs that reference them carry the source CNID stored here. Always false until SourceCatalogSnapshot::capture resolves the private dir.

§inode_num: Option<u32>

Source iNodeNum (decoded from the iNode<N> filename) for inode rows; None for ordinary files. Carried so the replay path can emit each hardlink stub with the same iNodeNum the inode itself will be created under on the target.

Implementations§

Source§

impl SourceFileSnapshot

Source

pub fn type_code(&self) -> String

Decoded type code (FInfo bytes 0..4) as a 4-character string.

Source

pub fn creator_code(&self) -> String

Decoded creator code (FInfo bytes 4..8) as a 4-character string.

Trait Implementations§

Source§

impl Clone for SourceFileSnapshot

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SourceFileSnapshot

Source§

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

Formats the value using the given formatter. Read more

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> 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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.