uqa_storage/
value_index_key.rs1#[derive(Debug, Clone, PartialEq, Eq)]
11pub enum ValueIndexEntry {
12 Unbuilt,
13 Absent,
14 Present(uqa_core::Value),
15}
16
17#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
18pub enum ValueIndexKey {
19 Column(String),
20 Index(String),
21}
22
23impl ValueIndexKey {
24 #[must_use]
25 pub fn name(&self) -> &str {
26 match self {
27 Self::Column(name) | Self::Index(name) => name,
28 }
29 }
30}
31
32impl From<&str> for ValueIndexKey {
33 fn from(name: &str) -> Self {
34 Self::Column(name.into())
35 }
36}
37
38impl From<String> for ValueIndexKey {
39 fn from(name: String) -> Self {
40 Self::Column(name)
41 }
42}
43
44impl std::fmt::Display for ValueIndexKey {
45 fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
46 match self {
47 Self::Column(name) => write!(formatter, "column {name}"),
48 Self::Index(name) => write!(formatter, "index {name}"),
49 }
50 }
51}