pub struct MftRecordHeader {Show 13 fields
pub signature: [u8; 4],
pub usa_offset: u16,
pub usa_count: u16,
pub lsn: u64,
pub sequence_number: u16,
pub hard_link_count: u16,
pub first_attribute_offset: u16,
pub flags: u16,
pub used_size: u32,
pub allocated_size: u32,
pub base_record: u64,
pub next_attr_id: u16,
pub record_number: u32,
}Expand description
Parsed MFT file-record-segment header.
Fields§
§signature: [u8; 4]Record signature: FILE (normal) or BAAD (chkdsk marked it corrupt).
usa_offset: u16Byte offset of the Update Sequence Array within the record.
usa_count: u16Number of u16 entries in the USA (1 USN + one original per sector).
lsn: u64$LogFile sequence number of the last change to this record.
sequence_number: u16Reuse counter — incremented each time this record number is reallocated.
hard_link_count: u16Number of hard links ($FILE_NAME attributes) to this record.
first_attribute_offset: u16Byte offset of the first attribute.
flags: u16Record flags (see is_in_use / is_directory).
used_size: u32Bytes of the record actually used.
allocated_size: u32Bytes allocated to the record (the record size).
base_record: u64File reference to the base record (0 when this is the base record).
next_attr_id: u16Id to assign to the next attribute added.
record_number: u32This record’s own number (Windows XP and later).
Implementations§
Source§impl MftRecordHeader
impl MftRecordHeader
Sourcepub fn is_directory(&self) -> bool
pub fn is_directory(&self) -> bool
true if the record describes a directory.
Sourcepub fn is_base_record(&self) -> bool
pub fn is_base_record(&self) -> bool
true if this is a base record (not an extension/child record).
Sourcepub fn is_corrupt(&self) -> bool
pub fn is_corrupt(&self) -> bool
true if chkdsk marked this record corrupt (BAAD signature).
Sourcepub fn parse(buf: &[u8]) -> Result<MftRecordHeader>
pub fn parse(buf: &[u8]) -> Result<MftRecordHeader>
Parse a record header from the start of a record buffer.
Does not apply the fixup (the header fields all precede the first
sector boundary). Validates the FILE/BAAD signature.
§Errors
NtfsError::TooShort if buf is smaller than the header, or
NtfsError::BadRecordSignature for an unrecognised signature.
Trait Implementations§
Source§impl Clone for MftRecordHeader
impl Clone for MftRecordHeader
Source§fn clone(&self) -> MftRecordHeader
fn clone(&self) -> MftRecordHeader
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MftRecordHeader
impl Debug for MftRecordHeader
impl Eq for MftRecordHeader
Source§impl PartialEq for MftRecordHeader
impl PartialEq for MftRecordHeader
Source§fn eq(&self, other: &MftRecordHeader) -> bool
fn eq(&self, other: &MftRecordHeader) -> bool
self and other values to be equal, and is used by ==.