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

Open3 implementation of ZpoolEngine. You can use ZpoolOpen3::default to create it.

Implementations§

source§

impl ZpoolOpen3

source

pub fn with_cmd<I: Into<OsString>>(cmd_name: I) -> ZpoolOpen3

Create new using supplied path as zpool cmd using “log” as backend for logging.

Trait Implementations§

source§

impl Default for ZpoolOpen3

source§

fn default() -> ZpoolOpen3

Uses log crate as drain for Slog. Tries to use ZPOOL_CMD from environment if variable is missing then it uses zpool from $PATH.

source§

impl ZpoolEngine for ZpoolOpen3

source§

fn exists<N: AsRef<str>>(&self, name: N) -> ZpoolResult<bool>

Check if pool with given name exists. NOTE: this won’t return ZpoolError::PoolNotFound, instead it will return Ok(false). Read more
source§

fn create(&self, request: CreateZpoolRequest) -> ZpoolResult<()>

Create new zpool. Read more
source§

fn destroy<N: AsRef<str>>(&self, name: N, mode: DestroyMode) -> ZpoolResult<()>

Destroy zpool. NOTE: returns Ok(()) if pool doesn’t exist. Read more
source§

fn read_properties<N: AsRef<str>>( &self, name: N ) -> ZpoolResult<ZpoolProperties>

Read properties of the pool. NOTE: doesn’t support custom properties. Read more
source§

fn set_property<N: AsRef<str>, P: PropPair>( &self, name: N, key: &str, value: &P ) -> ZpoolResult<()>

Internal function used to set values. Prefer update_properties when possible. Read more
source§

fn export<N: AsRef<str>>(&self, name: N, mode: ExportMode) -> ZpoolResult<()>

Exports the given pools from the system. Read more
source§

fn available(&self) -> ZpoolResult<Vec<Zpool>>

List of pools available for import in /dev/ directory.
source§

fn available_in_dir(&self, dir: PathBuf) -> ZpoolResult<Vec<Zpool>>

List of pools available in dir. Read more
source§

fn import<N: AsRef<str>>(&self, name: N) -> Result<(), ZpoolError>

Import pool from /dev/.
source§

fn import_from_dir<N: AsRef<str>>( &self, name: N, dir: PathBuf ) -> ZpoolResult<()>

Import pool from dir. Read more
source§

fn status<N: AsRef<str>>( &self, name: N, opts: StatusOptions ) -> ZpoolResult<Zpool>

Get the detailed status of the given pools.
source§

fn status_all(&self, opts: StatusOptions) -> ZpoolResult<Vec<Zpool>>

Query status with options
source§

fn scrub<N: AsRef<str>>(&self, name: N) -> ZpoolResult<()>

Begins a scrub or resumes a paused scrub. The scrub examines all data in the specified pools to verify that it checksums correctly. For replicated (mirror or raidz) devices, ZFS automatically repairs any damage discovered during the scrub. Read more
source§

fn pause_scrub<N: AsRef<str>>(&self, name: N) -> ZpoolResult<()>

Pause scrubbing. Scrub pause state and progress are periodically synced to disk. If the system is restarted or pool is exported during a paused scrub, even after import, scrub will remain paused until it is resumed. Once resumed the scrub will pick up from the place where it was last checkpointed to disk. Read more
source§

fn stop_scrub<N: AsRef<str>>(&self, name: N) -> ZpoolResult<()>

Stop scrubbing. Read more
source§

fn take_offline<N: AsRef<str>, D: AsRef<OsStr>>( &self, name: N, device: D, mode: OfflineMode ) -> ZpoolResult<()>

Takes the specified physical device offline. While the device is offline, no attempt is made to read or write to the device. Read more
source§

fn bring_online<N: AsRef<str>, D: AsRef<OsStr>>( &self, name: N, device: D, mode: OnlineMode ) -> ZpoolResult<()>

Brings the specified physical device online. Read more
source§

fn attach<N: AsRef<str>, D: AsRef<OsStr>>( &self, name: N, device: D, new_device: D ) -> ZpoolResult<()>

Attaches new_device (disk) to an existing zpool device (VDEV). The existing device cannot be part of a raidz configuration. If device is not currently part of a mirrored configuration, device automatically transforms into a two-way mirror of device and new_device. Read more
source§

fn detach<N: AsRef<str>, D: AsRef<OsStr>>( &self, name: N, device: D ) -> ZpoolResult<()>

Detaches device from a mirror. The operation is refused if there are no other valid replicas of the data. Read more
source§

fn add_vdev<N: AsRef<str>>( &self, name: N, new_vdev: CreateVdevRequest, add_mode: CreateMode ) -> Result<(), ZpoolError>

Add a VDEV to existing Zpool. Read more
source§

fn add_zil<N: AsRef<str>>( &self, name: N, new_zil: CreateVdevRequest, add_mode: CreateMode ) -> Result<(), ZpoolError>

Add a ZIL to existing Zpool. Read more
source§

fn add_cache<N: AsRef<str>, D: AsRef<OsStr>>( &self, name: N, new_cache: D, add_mode: CreateMode ) -> Result<(), ZpoolError>

Add a cache to existing Zpool. Read more
source§

fn add_spare<N: AsRef<str>, D: AsRef<OsStr>>( &self, name: N, new_spare: D, add_mode: CreateMode ) -> Result<(), ZpoolError>

Add a spare to existing Zpool. Read more
source§

fn replace_disk<N: AsRef<str>, D: AsRef<OsStr>, O: AsRef<OsStr>>( &self, name: N, old_disk: D, new_disk: O ) -> Result<(), ZpoolError>

Replace a device with another. Read more
source§

fn remove<N: AsRef<str>, D: AsRef<OsStr>>( &self, name: N, device: D ) -> ZpoolResult<()>

Remove Spare, Cache or log device Read more
source§

fn update_properties<N: AsRef<str>>( &self, name: N, props: ZpoolPropertiesWrite ) -> ZpoolResult<ZpoolProperties>

Update zpool properties. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
source§

impl<T> SendSyncUnwindSafe for Twhere T: Send + Sync + UnwindSafe + ?Sized,