/* * This source code is released into the public domain. */ #ifndef LFJAIL_ZFS_HH #define LFJAIL_ZFS_HH #include "generator.hh" #include "generic_error.hh" namespace lfjail::zfs { /* * Exception thrown when a ZFS operation fails. */ struct zfs_error final : generic_error { zfs_error(std::string what_) : generic_error("{}", std::move(what_)) {} }; /* * Pools. */ struct pool { std::string name; }; /* Fetch details for a specific pool by name. */ auto get_pool(std::string_view name) -> pool; /* Fetch details for all pools on the system. */ auto get_pools() -> std::generator; /* * Datasets. */ struct dataset { std::string name; }; /* Return true if a dataset by this name exists. */ auto dataset_exists(std::string_view name) -> bool; /* Fetch details for a specific dataset by name. */ auto get_dataset(std::string_view name) -> dataset; /* Fetch names for all datasets on the system. */ auto get_dataset_names() -> std::generator; /* Fetch details for all datasets on the system. */ auto get_datasets() -> std::generator; } // namespace lfjail::zfs #endif // LFJAIL_ZFS_HH