use uuid::Uuid;
use super::lookup::Lookup;
use crate::catalog::{DatabaseId, NamespaceId};
#[derive(Hash, Eq, PartialEq)]
pub(crate) enum Key {
#[cfg(feature = "jwks")]
Jwk(String),
Fds(NamespaceId, DatabaseId, String, Uuid),
Evs(NamespaceId, DatabaseId, String, Uuid),
Fts(NamespaceId, DatabaseId, String, Uuid),
Ixs(NamespaceId, DatabaseId, String, Uuid),
Lvs(NamespaceId, DatabaseId, String, Uuid),
}
impl<'a> From<Lookup<'a>> for Key {
fn from(value: Lookup<'a>) -> Self {
match value {
#[cfg(feature = "jwks")]
Lookup::Jwk(a) => Key::Jwk(a.to_string()),
Lookup::Fds(a, b, c, d) => Key::Fds(a, b, c.to_string(), d),
Lookup::Evs(a, b, c, d) => Key::Evs(a, b, c.to_string(), d),
Lookup::Fts(a, b, c, d) => Key::Fts(a, b, c.to_string(), d),
Lookup::Ixs(a, b, c, d) => Key::Ixs(a, b, c.to_string(), d),
Lookup::Lvs(a, b, c, d) => Key::Lvs(a, b, c.to_string(), d),
}
}
}