Struct FsEntry

Source
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

Source

pub fn from_line_str(line: &str) -> Result<Self, FsTableError>

Parse a FsEntry from a line in the fstab file.

Source

pub fn to_line_str(&self) -> String

Serialize the FsEntry into a string that can be written to the fstab file.

Trait Implementations§

Source§

impl Clone for FsEntry

Source§

fn clone(&self) -> FsEntry

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for FsEntry

Source§

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

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

impl Default for FsEntry

Source§

fn default() -> FsEntry

Returns the “default value” for a type. Read more
Source§

impl Display for FsEntry

Source§

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

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

impl TryFrom<&str> for FsEntry

Source§

type Error = FsTableError

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

fn try_from(value: &str) -> Result<Self, FsTableError>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

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

Source§

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
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

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

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

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.