2023-08-17 18:03:46 +00:00
|
|
|
use revision::revisioned;
|
2023-07-21 18:41:36 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
use std::fmt::{Display, Formatter, Result};
|
|
|
|
|
2023-08-18 22:51:56 +00:00
|
|
|
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
|
2023-08-17 18:03:46 +00:00
|
|
|
#[revisioned(revision = 1)]
|
2024-01-09 15:34:52 +00:00
|
|
|
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
|
2023-07-21 18:41:36 +00:00
|
|
|
pub enum With {
|
|
|
|
NoIndex,
|
|
|
|
Index(Vec<String>),
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Display for With {
|
|
|
|
fn fmt(&self, f: &mut Formatter) -> Result {
|
|
|
|
f.write_str("WITH")?;
|
|
|
|
match self {
|
|
|
|
With::NoIndex => f.write_str(" NOINDEX"),
|
|
|
|
With::Index(i) => {
|
|
|
|
f.write_str(" INDEX ")?;
|
|
|
|
f.write_str(&i.join(","))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|