pub enum CreateVdevRequest {
    SingleDisk(PathBuf),
    Mirror(Vec<PathBuf>),
    RaidZ(Vec<PathBuf>),
    RaidZ2(Vec<PathBuf>),
    RaidZ3(Vec<PathBuf>),
}
Expand description

Consumer friendly wrapper to configure vdev to zpol.

Variants

SingleDisk(PathBuf)

The most basic type of vdev is a standard block device. This can be an entire disk or a partition. In addition to disks, ZFS pools can be backed by regular files, this is especially useful for testing and experimentation. Use the full path to the file as the device path in zpool create. All vdevs must be at least 64MB or 128 MB in size depending on implementation.

Mirror(Vec<PathBuf>)

A mirror of multiple disks. A mirror vdev will only hold as much data as its smallest member. A mirror vdev can withstand the failure of all but one of its members without losing any data.

RaidZ(Vec<PathBuf>)

ZFS implements RAID-Z, a variation on standard RAID-5 that offers better distribution of parity and eliminates the “RAID-5 write hole”.

RaidZ2(Vec<PathBuf>)

The same as RAID-Z, but with 2 parity drives.

RaidZ3(Vec<PathBuf>)

The same as RAID-Z, but with 3 parity drives.

Implementations

Check if given CreateVdevRequest is valid.

For SingleDisk it means that what ever it points to exists.

For Mirror it checks that it’s at least two valid disks.

For RaidZ it checks that it’s at least three valid disk. And so goes on. This gives false negative results in RAIDZ2 and RAIDZ3. This is intentional. possible makes no sense.

Make turn CreateVdevRequest into list of arguments.

Short-cut to CreateVdevRequest::SingleDisk(disk)

Get kind

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.