Add function for raw string output
This commit is contained in:
parent
07a2e5f009
commit
06363e29a7
1 changed files with 18 additions and 0 deletions
|
@ -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(),
|
||||
|
|
Loading…
Reference in a new issue