Fat32BootSector

Struct Fat32BootSector 

Source
#[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: u16

Bytes per sector (typically 512)

§sectors_per_cluster: u8

Sectors per cluster (must be power of 2)

§reserved_sectors: u16

Number of reserved sectors (including boot sector)

§fat_count: u8

Number of FAT copies (typically 2)

§max_root_entries: u16

Maximum number of root directory entries (0 for FAT32)

§total_sectors_16: u16

Total sectors (16-bit, 0 for FAT32)

§media_descriptor: u8

Media descriptor

§sectors_per_fat_16: u16

Sectors per FAT (16-bit, 0 for FAT32)

§sectors_per_track: u16

Sectors per track

§heads: u16

Number of heads

§hidden_sectors: u32

Hidden sectors

§total_sectors_32: u32

Total sectors (32-bit)

§sectors_per_fat: u32

Sectors per FAT (32-bit)

§extended_flags: u16

Extended flags

§fs_version: u16

Filesystem version

§root_cluster: u32

Root directory cluster number

§fs_info_sector: u16

Filesystem info sector number

§backup_boot_sector: u16

Backup boot sector location

§reserved: [u8; 12]

Reserved bytes

§drive_number: u8

Drive number

§reserved1: u8

Reserved

§boot_signature: u8

Boot signature

§volume_serial: u32

Volume serial number

§volume_label: [u8; 11]

Volume label

§fs_type: [u8; 8]

Filesystem type string

§boot_code: [u8; 420]

Boot code

§signature: u16

Boot sector signature (0xAA55)

Implementations§

Source§

impl Fat32BootSector

Source

pub fn is_valid(&self) -> bool

Check if this is a valid FAT32 boot sector

Source

pub fn total_sectors(&self) -> u32

Get the total number of sectors

Source

pub fn first_data_sector(&self) -> u32

Calculate the first data sector

Source

pub fn data_sectors(&self) -> u32

Calculate the number of data sectors

Source

pub fn cluster_count(&self) -> u32

Calculate the number of clusters

Trait Implementations§

Source§

impl Clone for Fat32BootSector

Source§

fn clone(&self) -> Fat32BootSector

Returns a duplicate of the value. Read more
1.0.0§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Fat32BootSector

Source§

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

Formats the value using the given formatter. Read more
Source§

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 T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

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
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.