#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RequestedKeyType {
Keyid,
Fingerprint,
Grip,
}
impl RequestedKeyType {
pub fn as_str(self) -> &'static str {
match self {
RequestedKeyType::Keyid => "keyid",
RequestedKeyType::Fingerprint => "fingerprint",
RequestedKeyType::Grip => "grip",
}
}
pub fn parse(s: &str) -> Self {
match s {
"keyid" => Self::Keyid,
"fingerprint" => Self::Fingerprint,
"grip" => Self::Grip,
_ => Self::Keyid,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum KeyRequestOutcome {
Found,
NotFound,
}