use serde::{Deserialize, Serialize};
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ChartAlgorithmKind {
QuanShu,
Zhongzhou,
Placeholder,
}
#[derive(Clone, Debug, Eq, PartialEq, Hash, Serialize, Deserialize)]
pub struct MethodProfile {
id: String,
algorithm_kind: ChartAlgorithmKind,
description: String,
}
impl MethodProfile {
pub fn new(
id: impl Into<String>,
algorithm_kind: ChartAlgorithmKind,
description: impl Into<String>,
) -> Self {
Self {
id: id.into(),
algorithm_kind,
description: description.into(),
}
}
pub fn placeholder(id: impl Into<String>) -> Self {
Self::new(
id,
ChartAlgorithmKind::Placeholder,
"placeholder method profile; chart algorithms are not implemented",
)
}
pub fn id(&self) -> &str {
&self.id
}
pub const fn algorithm_kind(&self) -> ChartAlgorithmKind {
self.algorithm_kind
}
pub fn description(&self) -> &str {
&self.description
}
}