pub struct BootSector {
pub bytes_per_sector: u16,
pub sectors_per_cluster: u8,
pub total_sectors: u64,
pub mft_lcn: u64,
pub mftmirr_lcn: u64,
pub mft_record_size: u64,
pub index_record_size: u64,
pub volume_serial: u64,
}Expand description
Parsed NTFS boot sector geometry.
Fields§
§bytes_per_sector: u16Bytes per logical sector (power of two, 256..=4096; typically 512).
sectors_per_cluster: u8Logical sectors per cluster (power of two; typically 8).
total_sectors: u64Total number of sectors in the volume.
mft_lcn: u64Cluster number (LCN) of the $MFT.
mftmirr_lcn: u64Cluster number (LCN) of the $MFTMirr.
mft_record_size: u64Size of one MFT file-record segment, in bytes (typically 1024).
index_record_size: u64Size of one index buffer, in bytes (typically 4096).
volume_serial: u6464-bit volume serial number.
Implementations§
Source§impl BootSector
impl BootSector
Sourcepub fn cluster_size(&self) -> u64
pub fn cluster_size(&self) -> u64
Cluster size in bytes (bytes_per_sector × sectors_per_cluster).
Sourcepub fn mft_byte_offset(&self) -> u64
pub fn mft_byte_offset(&self) -> u64
Absolute byte offset of the $MFT within the volume.
Sourcepub fn mftmirr_byte_offset(&self) -> u64
pub fn mftmirr_byte_offset(&self) -> u64
Absolute byte offset of the $MFTMirr within the volume.
Sourcepub fn parse(sector: &[u8]) -> Result<BootSector>
pub fn parse(sector: &[u8]) -> Result<BootSector>
Parse an NTFS boot sector from the start of a volume.
§Errors
Returns NtfsError::TooShort if sector is smaller than the BPB,
NtfsError::BadOemId if it is not an NTFS volume, and the various
Bad* variants for out-of-range geometry fields.
Trait Implementations§
Source§impl Clone for BootSector
impl Clone for BootSector
Source§fn clone(&self) -> BootSector
fn clone(&self) -> BootSector
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 BootSector
impl Debug for BootSector
impl Eq for BootSector
Source§impl PartialEq for BootSector
impl PartialEq for BootSector
Source§fn eq(&self, other: &BootSector) -> bool
fn eq(&self, other: &BootSector) -> bool
self and other values to be equal, and is used by ==.