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),
}sql only.Expand description
Primitive SQL values such as number and string
Variants§
Number(String, bool)
bigdecimal only.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 From<Value> for ValueWithSpan
impl From<Value> for ValueWithSpan
Source§fn from(value: Value) -> ValueWithSpan
fn from(value: Value) -> ValueWithSpan
Source§impl From<ValueWithSpan> for Value
impl From<ValueWithSpan> for Value
Source§fn from(value: ValueWithSpan) -> Value
fn from(value: ValueWithSpan) -> Value
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>(&mut self, visitor: &mut V) -> ControlFlow<<V as VisitorMut>::Break>where
V: VisitorMut,
fn visit<V>(&mut self, visitor: &mut V) -> ControlFlow<<V as VisitorMut>::Break>where
V: VisitorMut,
VisitorMut. Read moreimpl Eq for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for Value
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more