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
sourceimpl CreateVdevRequest
impl CreateVdevRequest
sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
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.
sourcepub fn into_args(self) -> Vec<OsString>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn into_args(self) -> Vec<OsString>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Make turn CreateVdevRequest into list of arguments.
sourcepub fn disk<O: Into<PathBuf>>(value: O) -> CreateVdevRequest
pub fn disk<O: Into<PathBuf>>(value: O) -> CreateVdevRequest
Short-cut to CreateVdevRequest::SingleDisk(disk)
Trait Implementations
sourceimpl Clone for CreateVdevRequest
impl Clone for CreateVdevRequest
sourcefn clone(&self) -> CreateVdevRequest
fn clone(&self) -> CreateVdevRequest
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for CreateVdevRequest
impl Debug for CreateVdevRequest
sourceimpl PartialEq<CreateVdevRequest> for CreateVdevRequest
impl PartialEq<CreateVdevRequest> for CreateVdevRequest
sourcefn eq(&self, other: &CreateVdevRequest) -> bool
fn eq(&self, other: &CreateVdevRequest) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &CreateVdevRequest) -> bool
fn ne(&self, other: &CreateVdevRequest) -> bool
This method tests for !=.
sourceimpl PartialEq<CreateVdevRequest> for Vdev
impl PartialEq<CreateVdevRequest> for Vdev
sourceimpl PartialEq<Vdev> for CreateVdevRequest
impl PartialEq<Vdev> for CreateVdevRequest
impl Eq for CreateVdevRequest
impl StructuralEq for CreateVdevRequest
impl StructuralPartialEq for CreateVdevRequest
Auto Trait Implementations
impl RefUnwindSafe for CreateVdevRequest
impl Send for CreateVdevRequest
impl Sync for CreateVdevRequest
impl Unpin for CreateVdevRequest
impl UnwindSafe for CreateVdevRequest
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more