#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
pub enum ApiVersion {
#[default]
V2,
V3,
}
impl ApiVersion {
pub fn as_str(self) -> &'static str {
match self {
ApiVersion::V2 => "v2",
ApiVersion::V3 => "v3",
}
}
}
impl std::fmt::Display for ApiVersion {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}