use super::ConfigToml;
use dyn_clone::DynClone;
use std::path::Path;
pub trait DataDir: std::fmt::Debug + DynClone + Send + Sync {
fn path(&self) -> &Path;
fn ensure_data_dir_exists_and_is_writable(&self) -> anyhow::Result<()>;
fn read_or_create_config_file(&self) -> anyhow::Result<ConfigToml>;
fn read_or_create_keypair(&self) -> anyhow::Result<pkarr::Keypair>;
}
dyn_clone::clone_trait_object!(DataDir);