use clap::ValueEnum;
use clap::builder::PossibleValue;
#[derive(Clone, Debug)]
pub enum Time {
Seconds,
Millis,
Micros,
Nanos,
}
impl ValueEnum for Time {
fn value_variants<'a>() -> &'a [Self] {
&[Self::Seconds, Self::Millis, Self::Micros, Self::Nanos]
}
fn to_possible_value(&self) -> Option<PossibleValue> {
match self {
Self::Seconds => Some(PossibleValue::new("seconds")),
Self::Millis => Some(PossibleValue::new("millis")),
Self::Micros => Some(PossibleValue::new("micros")),
Self::Nanos => Some(PossibleValue::new("nanos")),
}
}
}
#[derive(Clone, Debug)]
pub enum UuidVersion {
V4,
V7,
}
impl ValueEnum for UuidVersion {
fn value_variants<'a>() -> &'a [Self] {
&[Self::V4]
}
fn to_possible_value(&self) -> Option<PossibleValue> {
match self {
Self::V4 => Some(PossibleValue::new("4")),
Self::V7 => Some(PossibleValue::new("7")),
}
}
}