pub enum Value {
Show 23 variants
Number(String, bool),
SingleQuotedString(String),
DollarQuotedString(DollarQuotedString),
TripleSingleQuotedString(String),
TripleDoubleQuotedString(String),
EscapedStringLiteral(String),
UnicodeStringLiteral(String),
SingleQuotedByteStringLiteral(String),
DoubleQuotedByteStringLiteral(String),
TripleSingleQuotedByteStringLiteral(String),
TripleDoubleQuotedByteStringLiteral(String),
SingleQuotedRawStringLiteral(String),
DoubleQuotedRawStringLiteral(String),
TripleSingleQuotedRawStringLiteral(String),
TripleDoubleQuotedRawStringLiteral(String),
NationalStringLiteral(String),
QuoteDelimitedStringLiteral(QuoteDelimitedString),
NationalQuoteDelimitedStringLiteral(QuoteDelimitedString),
HexStringLiteral(String),
DoubleQuotedString(String),
Boolean(bool),
Null,
Placeholder(String),
}Expand description
Primitive SQL values such as number and string
Variants§
Number(String, bool)
Numeric literal
SingleQuotedString(String)
‘string value’
DollarQuotedString(DollarQuotedString)
Dollar-quoted string literal, e.g. $$...$$ or $tag$...$tag$ (Postgres syntax).
TripleSingleQuotedString(String)
Triple single quoted strings: Example ‘’‘abc’‘’ BigQuery
TripleDoubleQuotedString(String)
Triple double quoted strings: Example “”“abc”“” BigQuery
EscapedStringLiteral(String)
e’string value’ (postgres extension) See Postgres docs for more details.
UnicodeStringLiteral(String)
u&‘string value’ (postgres extension) See Postgres docs for more details.
SingleQuotedByteStringLiteral(String)
B’string value’
DoubleQuotedByteStringLiteral(String)
B“string value“
TripleSingleQuotedByteStringLiteral(String)
Triple single quoted literal with byte string prefix. Example B'''abc'''
BigQuery
TripleDoubleQuotedByteStringLiteral(String)
Triple double quoted literal with byte string prefix. Example B"""abc"""
BigQuery
SingleQuotedRawStringLiteral(String)
Single quoted literal with raw string prefix. Example R'abc'
BigQuery
DoubleQuotedRawStringLiteral(String)
Double quoted literal with raw string prefix. Example R"abc"
BigQuery
TripleSingleQuotedRawStringLiteral(String)
Triple single quoted literal with raw string prefix. Example R'''abc'''
BigQuery
TripleDoubleQuotedRawStringLiteral(String)
Triple double quoted literal with raw string prefix. Example R"""abc"""
BigQuery
NationalStringLiteral(String)
N’string value’
QuoteDelimitedStringLiteral(QuoteDelimitedString)
Quote delimited literal. Examples Q'{ab'c}', Q'|ab'c|', Q'|ab|c|'
Oracle
NationalQuoteDelimitedStringLiteral(QuoteDelimitedString)
“National” quote delimited literal. Examples Q'{ab'c}', Q'|ab'c|', Q'|ab|c|'
Oracle
HexStringLiteral(String)
X’hex value’
DoubleQuotedString(String)
Double quoted string literal, e.g. "abc".
Boolean(bool)
Boolean value true or false
Null
NULL value
Placeholder(String)
? or $ Prepared statement arg placeholder
Implementations§
Source§impl Value
impl Value
Sourcepub fn into_string(self) -> Option<String>
pub fn into_string(self) -> Option<String>
If the underlying literal is a string, regardless of quote style, returns the associated string value
Sourcepub fn with_span(self, span: Span) -> ValueWithSpan
pub fn with_span(self, span: Span) -> ValueWithSpan
Attach the provided span to this Value and return ValueWithSpan.
Sourcepub fn with_empty_span(self) -> ValueWithSpan
pub fn with_empty_span(self) -> ValueWithSpan
Convenience for attaching an empty span to this Value.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<Value> for ValueWithSpan
impl From<Value> for ValueWithSpan
Source§impl From<ValueWithSpan> for Value
impl From<ValueWithSpan> for Value
Source§fn from(value: ValueWithSpan) -> Self
fn from(value: ValueWithSpan) -> Self
Source§impl Ord for Value
impl Ord for Value
Source§impl PartialOrd for Value
impl PartialOrd for Value
Source§impl VisitMut for Value
impl VisitMut for Value
Source§fn visit<V: VisitorMut>(&mut self, visitor: &mut V) -> ControlFlow<V::Break>
fn visit<V: VisitorMut>(&mut self, visitor: &mut V) -> ControlFlow<V::Break>
VisitorMut. Read more