#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum BuiltInTag {
Inst,
UUID,
}
impl BuiltInTag {
pub fn from_str(tag: &str) -> Option<Self> {
let tag = if tag.starts_with('#') { &tag[1..] } else { tag };
match tag {
"inst" => Some(Self::Inst),
"uuid" => Some(Self::UUID),
_ => None,
}
}
}
impl Into<&str> for BuiltInTag {
fn into(self) -> &'static str {
match self {
BuiltInTag::Inst => "inst",
BuiltInTag::UUID => "uuid",
}
}
}