use std::collections::BTreeMap;
#[derive(Debug, Clone, PartialEq)]
pub enum Value {
Null,
Bool(bool),
Int(i64),
Float(f64),
Str(String),
Bytes(Vec<u8>),
List(Vec<Value>),
Map(BTreeMap<String, Value>),
DateTime(String),
Date(String),
Decimal(String),
Uuid(String),
}
impl Value {
#[must_use]
pub fn is_null(&self) -> bool {
matches!(self, Value::Null)
}
#[must_use]
pub fn as_str(&self) -> Option<&str> {
match self {
Value::Str(s)
| Value::DateTime(s)
| Value::Date(s)
| Value::Decimal(s)
| Value::Uuid(s) => Some(s),
_ => None,
}
}
}