#[repr(C, packed(1))]pub struct Fat32BootSector {Show 29 fields
pub jump_instruction: [u8; 3],
pub oem_name: [u8; 8],
pub bytes_per_sector: u16,
pub sectors_per_cluster: u8,
pub reserved_sectors: u16,
pub fat_count: u8,
pub max_root_entries: u16,
pub total_sectors_16: u16,
pub media_descriptor: u8,
pub sectors_per_fat_16: u16,
pub sectors_per_track: u16,
pub heads: u16,
pub hidden_sectors: u32,
pub total_sectors_32: u32,
pub sectors_per_fat: u32,
pub extended_flags: u16,
pub fs_version: u16,
pub root_cluster: u32,
pub fs_info_sector: u16,
pub backup_boot_sector: u16,
pub reserved: [u8; 12],
pub drive_number: u8,
pub reserved1: u8,
pub boot_signature: u8,
pub volume_serial: u32,
pub volume_label: [u8; 11],
pub fs_type: [u8; 8],
pub boot_code: [u8; 420],
pub signature: u16,
}Expand description
FAT32 Boot Sector structure
This structure represents the boot sector (first sector) of a FAT32 filesystem. It contains essential information about the filesystem layout and parameters.
Fields§
§jump_instruction: [u8; 3]Jump instruction (3 bytes)
oem_name: [u8; 8]OEM name (8 bytes)
bytes_per_sector: u16Bytes per sector (typically 512)
sectors_per_cluster: u8Sectors per cluster (must be power of 2)
reserved_sectors: u16Number of reserved sectors (including boot sector)
fat_count: u8Number of FAT copies (typically 2)
max_root_entries: u16Maximum number of root directory entries (0 for FAT32)
total_sectors_16: u16Total sectors (16-bit, 0 for FAT32)
media_descriptor: u8Media descriptor
sectors_per_fat_16: u16Sectors per FAT (16-bit, 0 for FAT32)
sectors_per_track: u16Sectors per track
heads: u16Number of heads
Hidden sectors
total_sectors_32: u32Total sectors (32-bit)
sectors_per_fat: u32Sectors per FAT (32-bit)
extended_flags: u16Extended flags
fs_version: u16Filesystem version
root_cluster: u32Root directory cluster number
fs_info_sector: u16Filesystem info sector number
backup_boot_sector: u16Backup boot sector location
reserved: [u8; 12]Reserved bytes
drive_number: u8Drive number
reserved1: u8Reserved
boot_signature: u8Boot signature
volume_serial: u32Volume serial number
volume_label: [u8; 11]Volume label
fs_type: [u8; 8]Filesystem type string
boot_code: [u8; 420]Boot code
signature: u16Boot sector signature (0xAA55)
Implementations§
Source§impl Fat32BootSector
impl Fat32BootSector
Sourcepub fn total_sectors(&self) -> u32
pub fn total_sectors(&self) -> u32
Get the total number of sectors
Sourcepub fn first_data_sector(&self) -> u32
pub fn first_data_sector(&self) -> u32
Calculate the first data sector
Sourcepub fn data_sectors(&self) -> u32
pub fn data_sectors(&self) -> u32
Calculate the number of data sectors
Sourcepub fn cluster_count(&self) -> u32
pub fn cluster_count(&self) -> u32
Calculate the number of clusters
Trait Implementations§
Source§impl Clone for Fat32BootSector
impl Clone for Fat32BootSector
Source§fn clone(&self) -> Fat32BootSector
fn clone(&self) -> Fat32BootSector
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Fat32BootSector
impl Debug for Fat32BootSector
impl Copy for Fat32BootSector
Auto Trait Implementations§
impl Freeze for Fat32BootSector
impl RefUnwindSafe for Fat32BootSector
impl Send for Fat32BootSector
impl Sync for Fat32BootSector
impl Unpin for Fat32BootSector
impl UnwindSafe for Fat32BootSector
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)