Add function for raw string output

This commit is contained in:
Tobie Morgan Hitchcock 2023-01-14 18:33:12 +00:00
parent 07a2e5f009
commit 06363e29a7

View file

@ -835,6 +835,15 @@ impl Value {
}
}
pub fn as_raw_string(self) -> String {
match self {
Value::Strand(v) => v.0,
Value::Uuid(v) => v.to_raw(),
Value::Datetime(v) => v.to_raw(),
_ => self.as_string(),
}
}
// -----------------------------------
// Expensive conversion of value
// -----------------------------------
@ -875,6 +884,15 @@ impl Value {
}
}
pub fn to_raw_string(&self) -> String {
match self {
Value::Strand(v) => v.0.to_owned(),
Value::Uuid(v) => v.to_raw(),
Value::Datetime(v) => v.to_raw(),
_ => self.to_string(),
}
}
pub fn to_idiom(&self) -> Idiom {
match self {
Value::Param(v) => v.simplify(),