pub trait ConfigurationChoice {
fn prompt(&self) -> String;
fn description(&self) -> Option<String>;
fn all_descriptions(&self) -> Option<Vec<String>>;
fn all_names(&self) -> Vec<String>;
}
pub struct BoolChoice {
pub prompt: String,
pub default: bool,
}
#[allow(clippy::type_complexity)]
pub struct Input {
pub prompt: String,
pub validator: Option<Box<dyn Fn(&String) -> core::result::Result<(), String>>>,
}
#[allow(clippy::type_complexity)]
pub struct InputNumericu16 {
pub prompt: String,
pub validator: Option<Box<dyn Fn(&u16) -> core::result::Result<(), String>>>,
pub default: Option<u16>,
}
pub struct Password {
pub prompt: String,
pub confirm: bool,
}
pub trait UiClient {
fn get_configuration_choice(
&self,
conf_choice: &dyn ConfigurationChoice,
) -> anyhow::Result<usize>;
fn get_bool_choice(&self, bool_choice: BoolChoice) -> anyhow::Result<bool>;
fn get_input(&self, input: Input) -> anyhow::Result<String>;
fn get_input_numeric_u16(&self, input: InputNumericu16) -> anyhow::Result<u16>;
fn get_password(&self, password: Password) -> anyhow::Result<String>;
}