pub struct FsEntry {
pub device_spec: String,
pub mountpoint: Option<String>,
pub fs_type: String,
pub options: Vec<String>,
pub dump_freq: u8,
pub pass: FsckOrder,
}
Fields§
§device_spec: String
The device spec for mounting the filesystem.
Can be a device path, or some kind of filter to get the
device, i.e LABEL=ROOT
or UUID=1234-5678
Examples:
/dev/sda1
LABEL=ROOT
UUID=1234-5678
PARTUUID=1234-5678
PARTLABEL=ROOT
PARTUUID=1234-5678
PARTLABEL=ROOT
mountpoint: Option<String>
The mountpoint for the filesystem. Specifies where the filesystem should be mounted.
Doesn’t actually need to be a real mountpoint, but most of the time it will be.
Is an optional field, a None
value will serialize into none
.
Examples:
/
/boot
none
(for no mountpoint, used for swap or similar filesystems)/home
fs_type: String
The filesystem type for the filesystem.
Examples:
ext4
btrfs
vfat
- …
options: Vec<String>
Mount options for the filesystem. Is a comma-separated list of options.
This type returns a vector of strings, as there can be multiple options. They will be serialized into a comma-separated list.
dump_freq: u8
The dump frequency for the filesystem.
This is a number that specifies how often the filesystem should be backed up.
pass: FsckOrder
The pass number for the filesystem.
Determines when the filesystem health should be checked using fsck
.
Implementations§
Source§impl FsEntry
impl FsEntry
Sourcepub fn from_line_str(line: &str) -> Result<Self, FsTableError>
pub fn from_line_str(line: &str) -> Result<Self, FsTableError>
Parse a FsEntry from a line in the fstab file.
Sourcepub fn to_line_str(&self) -> String
pub fn to_line_str(&self) -> String
Serialize the FsEntry into a string that can be written to the fstab file.