1use crate::value::Value;
2use revision::revisioned;
3use serde::{Deserialize, Serialize};
4use std::fmt;
5use std::ops::Deref;
6
7#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
8#[revisioned(revision = 1)]
9pub struct Cond(pub Value);
10
11impl Deref for Cond {
12 type Target = Value;
13 fn deref(&self) -> &Self::Target {
14 &self.0
15 }
16}
17
18impl fmt::Display for Cond {
19 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
20 write!(f, "WHERE {}", self.0)
21 }
22}