pub struct FormatVolumeOptions { /* private fields */ }
Expand description

A FAT filesystem formatting options

This struct implements a builder pattern. Options are specified as an argument for format_volume function.

Implementations§

Create options struct for format_volume function

Allows to overwrite many filesystem parameters. In normal use-case defaults should suffice.

Set size of cluster in bytes (must be dividable by sector size)

Cluster size must be a power of two and be greater or equal to sector size. If option is not specified optimal cluster size is selected based on partition size and optionally FAT type override (if specified using fat_type method).

Set File Allocation Table type

Option allows to override File Allocation Table (FAT) entry size. It is unrecommended to set this option unless you know what you are doing. Note: FAT type is determined from total number of clusters. Changing this option can cause formatting to fail if the volume cannot be divided into proper number of clusters for selected FAT type.

Set sector size in bytes

Sector size must be a power of two and be in range 512 - 4096. Default is 512.

Set total number of sectors

If option is not specified total number of sectors is calculated as storage device size divided by sector size.

Set maximal numer of entries in root directory for FAT12/FAT16 volumes

Total root directory size should be dividable by sectors size so keep it a multiple of 16 (for default sector size). Note: this limit is not used on FAT32 volumes. Default is 512.

Set number of File Allocation Tables

The only allowed values are 1 and 2. If value 2 is used the FAT is mirrored. Default is 2.

Set media field for Bios Parameters Block

Default is 0xF8.

Set number of physical sectors per track for Bios Parameters Block (INT 13h CHS geometry)

Default is 0x20.

Set number of heads for Bios Parameters Block (INT 13h CHS geometry)

Default is 0x40.

Set drive number for Bios Parameters Block

Default is 0 for FAT12, 0x80 for FAT16/FAT32.

Set volume ID for Bios Parameters Block

Default is 0x12345678.

Set volume label

Default is empty label.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.