#[derive(Debug, Clone, Default)]
pub struct ClusterContext {
pub cluster_id: Option<String>,
pub endpoint: Option<String>,
pub database: String,
pub plan: Option<String>,
}
impl ClusterContext {
pub fn is_set(&self) -> bool {
self.cluster_id.is_some() && self.endpoint.is_some()
}
pub fn display_summary(&self) -> String {
match (&self.cluster_id, &self.plan) {
(Some(id), Some(plan)) => format!("{} ({})", id, plan),
(Some(id), None) => id.clone(),
_ => "No cluster selected".to_string(),
}
}
}