Expand description
Generic interface to work with zpools.
Somewhat poorly organized, but I’m afraid to do more refactoring here. The module consists of multiple parts:
- Regular expressions for error parsing. I want to switch to pest at one point
- Error enums: ZpoolError and
ZpoolErrorKind
- ZPoolError is used as an actual error
- ZPoolErrorKind is used for easy comparision because
io::Errordoesn’t implementEq
- Some enums for various fields to avoid using boring
bool - Main trait for everything Zpool related
- It’s implemented as trait for easy mocking
Re-exports§
pub use self::description::Reason;pub use self::description::Zpool;pub use self::open3::ZpoolOpen3;pub use self::properties::CacheType;pub use self::properties::FailMode;pub use self::properties::Health;pub use self::properties::PropPair;pub use self::properties::ZpoolProperties;pub use self::properties::ZpoolPropertiesWrite;pub use self::properties::ZpoolPropertiesWriteBuilder;pub use self::topology::CreateZpoolRequest;pub use self::topology::CreateZpoolRequestBuilder;pub use self::vdev::CreateVdevRequest;pub use self::vdev::Disk;pub use self::vdev::Vdev;pub use self::vdev::VdevType;
Modules§
- description
- If anyone has a better name for this module - hit me up. This module is where consumer friendly representation of Zpool is defined. This is where pest’s Pairs turned into Zpool.
- open3
- Open3 implementation of
ZpoolEngine. - properties
- Consumer friendly representation of Zpool’s properties.
- topology
- Structure representing what zpool consist of. This structure is used in zpool creation and when new drives are attached.
- vdev
- Consumer friendly structure representing vdev.
Enums§
- Create
Mode - Strategy to use when creating Zpool.
- Destroy
Mode - Strategy to use when destroying Zpool.
- Export
Mode - Strategy to use when exporting Zpool.
- Offline
Mode - Strategy to use when bringing device offline.
- Online
Mode - Strategy to use when bringing device online.
- Zpool
Error - Zpool sub-module errors. Every error returned by this module is wrapped into
ZpoolError. - Zpool
Error Kind - This is a hack to allow doing
Eqon errors becausestd::io::Errordoesn’t implementPartialEq. Error descriptions are copied from ZpoolError. Might be out of date.
Traits§
- Zpool
Engine - Interface to manage zpools. This documentation implies that you know how to use
zpool(8).
Type Aliases§
- Zpool
Result - Type alias to
Result<T, ZpoolError>.