pub struct Bpb<'a> { /* private fields */ }
Expand description
Represents a Boot Parameter Block. This is the first sector of a FAT formatted partition, and it describes various properties of the FAT filesystem.
Implementations§
Source§impl<'a> Bpb<'a>
impl<'a> Bpb<'a>
Sourcepub fn create_from_bytes(data: &[u8; 512]) -> Result<Bpb<'_>, &'static str>
pub fn create_from_bytes(data: &[u8; 512]) -> Result<Bpb<'_>, &'static str>
Attempt to parse a Boot Parameter Block from a 512 byte sector.
Sourcepub fn bytes_per_block(&self) -> u16
pub fn bytes_per_block(&self) -> u16
Get the value from the $name field
Sourcepub fn blocks_per_cluster(&self) -> u8
pub fn blocks_per_cluster(&self) -> u8
Get the value from the $name field
Sourcepub fn reserved_block_count(&self) -> u16
pub fn reserved_block_count(&self) -> u16
Get the value from the $name field
Sourcepub fn root_entries_count(&self) -> u16
pub fn root_entries_count(&self) -> u16
Get the value from the $name field
Sourcepub fn total_blocks16(&self) -> u16
pub fn total_blocks16(&self) -> u16
Get the value from the $name field
Sourcepub fn fat_size16(&self) -> u16
pub fn fat_size16(&self) -> u16
Get the value from the $name field
Sourcepub fn blocks_per_track(&self) -> u16
pub fn blocks_per_track(&self) -> u16
Get the value from the $name field
Get the $name field
Sourcepub fn total_blocks32(&self) -> u32
pub fn total_blocks32(&self) -> u32
Get the $name field
Get the value from the $name field
Sourcepub fn fat_size32(&self) -> u32
pub fn fat_size32(&self) -> u32
Get the $name field
Sourcepub fn first_root_dir_cluster(&self) -> u32
pub fn first_root_dir_cluster(&self) -> u32
Get the $name field
Sourcepub fn backup_boot_block(&self) -> u16
pub fn backup_boot_block(&self) -> u16
Get the value from the $name field
Sourcepub fn volume_label(&self) -> &[u8]
pub fn volume_label(&self) -> &[u8]
Get the Volume Label string for this volume
Sourcepub fn fs_info_block(&self) -> Option<BlockCount>
pub fn fs_info_block(&self) -> Option<BlockCount>
On a FAT32 volume, return the free block count from the Info Block. On a FAT16 volume, returns None.
Sourcepub fn total_blocks(&self) -> u32
pub fn total_blocks(&self) -> u32
Get the total number of blocks in this filesystem.
Sourcepub fn total_clusters(&self) -> u32
pub fn total_clusters(&self) -> u32
Get the total number of clusters in this filesystem.