pub enum Value {
Show 29 variants
Bool(Option<bool>),
TinyInt(Option<i8>),
SmallInt(Option<i16>),
Int(Option<i32>),
BigInt(Option<i64>),
TinyUnsigned(Option<u8>),
SmallUnsigned(Option<u16>),
Unsigned(Option<u32>),
BigUnsigned(Option<u64>),
Float(Option<f32>),
Double(Option<f64>),
String(Option<Box<String>>),
Char(Option<char>),
Bytes(Option<Box<Vec<u8>>>),
Json(Option<Box<Value>>),
ChronoDate(Option<Box<NaiveDate>>),
ChronoTime(Option<Box<NaiveTime>>),
ChronoDateTime(Option<Box<NaiveDateTime>>),
ChronoDateTimeUtc(Option<Box<DateTime<Utc>>>),
ChronoDateTimeLocal(Option<Box<DateTime<Local>>>),
ChronoDateTimeWithTimeZone(Option<Box<DateTime<FixedOffset>>>),
TimeDate(Option<Box<Date>>),
TimeTime(Option<Box<Time>>),
TimeDateTime(Option<Box<PrimitiveDateTime>>),
TimeDateTimeWithTimeZone(Option<Box<OffsetDateTime>>),
Uuid(Option<Box<Uuid>>),
Decimal(Option<Box<Decimal>>),
BigDecimal(Option<Box<BigDecimal>>),
Array(ArrayType, Option<Box<Vec<Value>>>),
}
Expand description
Value variants
We want the inner Value to be exactly 1 pointer sized, so anything larger should be boxed.
If the hashable-value
feature is enabled, NaN == NaN, which contradicts Rustโs built-in
implementation of NaN != NaN.
Variantsยง
Bool(Option<bool>)
TinyInt(Option<i8>)
SmallInt(Option<i16>)
Int(Option<i32>)
BigInt(Option<i64>)
TinyUnsigned(Option<u8>)
SmallUnsigned(Option<u16>)
Unsigned(Option<u32>)
BigUnsigned(Option<u64>)
Float(Option<f32>)
Double(Option<f64>)
String(Option<Box<String>>)
Char(Option<char>)
Bytes(Option<Box<Vec<u8>>>)
Json(Option<Box<Value>>)
ChronoDate(Option<Box<NaiveDate>>)
ChronoTime(Option<Box<NaiveTime>>)
ChronoDateTime(Option<Box<NaiveDateTime>>)
ChronoDateTimeUtc(Option<Box<DateTime<Utc>>>)
ChronoDateTimeLocal(Option<Box<DateTime<Local>>>)
ChronoDateTimeWithTimeZone(Option<Box<DateTime<FixedOffset>>>)
TimeDate(Option<Box<Date>>)
TimeTime(Option<Box<Time>>)
TimeDateTime(Option<Box<PrimitiveDateTime>>)
TimeDateTimeWithTimeZone(Option<Box<OffsetDateTime>>)
Uuid(Option<Box<Uuid>>)
Decimal(Option<Box<Decimal>>)
BigDecimal(Option<Box<BigDecimal>>)
Array(ArrayType, Option<Box<Vec<Value>>>)
Implementationsยง
sourceยงimpl Value
impl Value
pub fn is_chrono_date(&self) -> bool
pub fn as_ref_chrono_date(&self) -> Option<&NaiveDate>
sourceยงimpl Value
impl Value
pub fn is_time_date(&self) -> bool
pub fn as_ref_time_date(&self) -> Option<&Date>
sourceยงimpl Value
impl Value
pub fn is_chrono_time(&self) -> bool
pub fn as_ref_chrono_time(&self) -> Option<&NaiveTime>
sourceยงimpl Value
impl Value
pub fn is_time_time(&self) -> bool
pub fn as_ref_time_time(&self) -> Option<&Time>
sourceยงimpl Value
impl Value
pub fn is_chrono_date_time(&self) -> bool
pub fn as_ref_chrono_date_time(&self) -> Option<&NaiveDateTime>
sourceยงimpl Value
impl Value
pub fn is_time_date_time(&self) -> bool
pub fn as_ref_time_date_time(&self) -> Option<&PrimitiveDateTime>
sourceยงimpl Value
impl Value
pub fn is_chrono_date_time_utc(&self) -> bool
pub fn as_ref_chrono_date_time_utc(&self) -> Option<&DateTime<Utc>>
sourceยงimpl Value
impl Value
pub fn is_chrono_date_time_local(&self) -> bool
pub fn as_ref_chrono_date_time_local(&self) -> Option<&DateTime<Local>>
sourceยงimpl Value
impl Value
pub fn is_chrono_date_time_with_time_zone(&self) -> bool
pub fn as_ref_chrono_date_time_with_time_zone( &self, ) -> Option<&DateTime<FixedOffset>>
sourceยงimpl Value
impl Value
pub fn is_time_date_time_with_time_zone(&self) -> bool
pub fn as_ref_time_date_time_with_time_zone(&self) -> Option<&OffsetDateTime>
sourceยงimpl Value
impl Value
pub fn is_decimal(&self) -> bool
pub fn as_ref_decimal(&self) -> Option<&Decimal>
pub fn decimal_to_f64(&self) -> Option<f64>
sourceยงimpl Value
impl Value
pub fn is_big_decimal(&self) -> bool
pub fn as_ref_big_decimal(&self) -> Option<&BigDecimal>
pub fn big_decimal_to_f64(&self) -> Option<f64>
Trait Implementationsยง
sourceยงimpl From<BigDecimal> for Value
impl From<BigDecimal> for Value
sourceยงfn from(x: BigDecimal) -> Value
fn from(x: BigDecimal) -> Value
Converts to this type from the input type.
sourceยงimpl From<Hyphenated> for Value
impl From<Hyphenated> for Value
sourceยงfn from(x: Hyphenated) -> Value
fn from(x: Hyphenated) -> Value
Converts to this type from the input type.
sourceยงimpl From<NaiveDateTime> for Value
impl From<NaiveDateTime> for Value
sourceยงfn from(x: NaiveDateTime) -> Value
fn from(x: NaiveDateTime) -> Value
Converts to this type from the input type.
sourceยงimpl From<OffsetDateTime> for Value
impl From<OffsetDateTime> for Value
sourceยงfn from(v: OffsetDateTime) -> Value
fn from(v: OffsetDateTime) -> Value
Converts to this type from the input type.
sourceยงimpl From<PrimitiveDateTime> for Value
impl From<PrimitiveDateTime> for Value
sourceยงfn from(x: PrimitiveDateTime) -> Value
fn from(x: PrimitiveDateTime) -> Value
Converts to this type from the input type.
sourceยงimpl PgExpr for Value
impl PgExpr for Value
sourceยงfn concatenate<T>(self, right: T) -> SimpleExprwhere
T: Into<SimpleExpr>,
fn concatenate<T>(self, right: T) -> SimpleExprwhere
T: Into<SimpleExpr>,
Express an postgres concatenate (
||
) expression. Read moresourceยงfn concat<T>(self, right: T) -> SimpleExprwhere
T: Into<SimpleExpr>,
fn concat<T>(self, right: T) -> SimpleExprwhere
T: Into<SimpleExpr>,
Alias of
PgExpr::concatenate
sourceยงfn matches<T>(self, expr: T) -> SimpleExprwhere
T: Into<SimpleExpr>,
fn matches<T>(self, expr: T) -> SimpleExprwhere
T: Into<SimpleExpr>,
Express an postgres fulltext search matches (
@@
) expression. Read moresourceยงfn contains<T>(self, expr: T) -> SimpleExprwhere
T: Into<SimpleExpr>,
fn contains<T>(self, expr: T) -> SimpleExprwhere
T: Into<SimpleExpr>,
Express an postgres fulltext search contains (
@>
) expression. Read moresourceยงfn contained<T>(self, expr: T) -> SimpleExprwhere
T: Into<SimpleExpr>,
fn contained<T>(self, expr: T) -> SimpleExprwhere
T: Into<SimpleExpr>,
Express an postgres fulltext search contained (
<@
) expression. Read moresourceยงfn ilike<L>(self, like: L) -> SimpleExprwhere
L: IntoLikeExpr,
fn ilike<L>(self, like: L) -> SimpleExprwhere
L: IntoLikeExpr,
Express a
ILIKE
expression. Read moresourceยงfn not_ilike<L>(self, like: L) -> SimpleExprwhere
L: IntoLikeExpr,
fn not_ilike<L>(self, like: L) -> SimpleExprwhere
L: IntoLikeExpr,
Express a
NOT ILIKE
expressionsourceยงfn get_json_field<T>(self, right: T) -> SimpleExprwhere
T: Into<SimpleExpr>,
fn get_json_field<T>(self, right: T) -> SimpleExprwhere
T: Into<SimpleExpr>,
Express a postgres retrieves JSON field as JSON value (
->
). Read moresourceยงfn cast_json_field<T>(self, right: T) -> SimpleExprwhere
T: Into<SimpleExpr>,
fn cast_json_field<T>(self, right: T) -> SimpleExprwhere
T: Into<SimpleExpr>,
Express a postgres retrieves JSON field and casts it to an appropriate SQL type (
->>
). Read moresourceยงimpl SqliteExpr for Value
impl SqliteExpr for Value
sourceยงfn glob<T>(self, right: T) -> SimpleExprwhere
T: Into<SimpleExpr>,
fn glob<T>(self, right: T) -> SimpleExprwhere
T: Into<SimpleExpr>,
Express an sqlite
GLOB
operator. Read moresourceยงfn matches<T>(self, right: T) -> SimpleExprwhere
T: Into<SimpleExpr>,
fn matches<T>(self, right: T) -> SimpleExprwhere
T: Into<SimpleExpr>,
Express an sqlite
MATCH
operator. Read moresourceยงfn get_json_field<T>(self, right: T) -> SimpleExprwhere
T: Into<SimpleExpr>,
fn get_json_field<T>(self, right: T) -> SimpleExprwhere
T: Into<SimpleExpr>,
Express an sqlite retrieves JSON field as JSON value (
->
). Read moresourceยงfn cast_json_field<T>(self, right: T) -> SimpleExprwhere
T: Into<SimpleExpr>,
fn cast_json_field<T>(self, right: T) -> SimpleExprwhere
T: Into<SimpleExpr>,
Express an sqlite retrieves JSON field and casts it to an appropriate SQL type (
->>
). Read moreimpl Eq 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 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
Mutably borrows from an owned value. Read more
sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
sourceยงunsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
๐ฌThis is a nightly-only experimental API. (
clone_to_uninit
)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<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
Compare self to
key
and return true
if they are equal.sourceยงimpl<T> ExprTrait for Twhere
T: Into<SimpleExpr>,
impl<T> ExprTrait for Twhere
T: Into<SimpleExpr>,
sourceยงfn as_enum<N>(self, type_name: N) -> SimpleExprwhere
N: IntoIden,
fn as_enum<N>(self, type_name: N) -> SimpleExprwhere
N: IntoIden,
Express a
AS enum
expression. Read moresourceยงfn binary<O, R>(self, op: O, right: R) -> SimpleExpr
fn binary<O, R>(self, op: O, right: R) -> SimpleExpr
Create any binary operation Read more
sourceยงfn cast_as<N>(self, type_name: N) -> SimpleExprwhere
N: IntoIden,
fn cast_as<N>(self, type_name: N) -> SimpleExprwhere
N: IntoIden,
Express a
CAST AS
expression. Read moresourceยงfn unary(self, op: UnOper) -> SimpleExpr
fn unary(self, op: UnOper) -> SimpleExpr
Apply any unary operator to the expression. Read more
sourceยงfn add<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
fn add<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
Express an arithmetic addition operation. Read more
fn and<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
sourceยงfn between<A, B>(self, a: A, b: B) -> SimpleExpr
fn between<A, B>(self, a: A, b: B) -> SimpleExpr
Express a
BETWEEN
expression. Read moresourceยงfn div<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
fn div<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
Express an arithmetic division operation. Read more
sourceยงfn eq<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
fn eq<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
Express an equal (
=
) expression. Read moresourceยงfn equals<C>(self, col: C) -> SimpleExprwhere
C: IntoColumnRef,
fn equals<C>(self, col: C) -> SimpleExprwhere
C: IntoColumnRef,
Express a equal expression between two table columns,
you will mainly use this to relate identical value between two table columns. Read more
sourceยงfn gt<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
fn gt<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
Express a greater than (
>
) expression. Read moresourceยงfn gte<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
fn gte<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
Express a greater than or equal (
>=
) expression. Read moresourceยงfn in_subquery(self, sel: SelectStatement) -> SimpleExpr
fn in_subquery(self, sel: SelectStatement) -> SimpleExpr
Express a
IN
sub-query expression. Read moresourceยงfn in_tuples<V, I>(self, v: I) -> SimpleExprwhere
V: IntoValueTuple,
I: IntoIterator<Item = V>,
fn in_tuples<V, I>(self, v: I) -> SimpleExprwhere
V: IntoValueTuple,
I: IntoIterator<Item = V>,
Express a
IN
sub expression. Read moresourceยงfn is<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
fn is<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
Express a
IS
expression. Read moresourceยงfn is_in<V, I>(self, v: I) -> SimpleExpr
fn is_in<V, I>(self, v: I) -> SimpleExpr
Express a
IN
expression. Read moresourceยงfn is_not<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
fn is_not<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
Express a
IS NOT
expression. Read moresourceยงfn is_not_in<V, I>(self, v: I) -> SimpleExpr
fn is_not_in<V, I>(self, v: I) -> SimpleExpr
Express a
NOT IN
expression. Read moresourceยงfn is_not_null(self) -> SimpleExpr
fn is_not_null(self) -> SimpleExpr
Express a
IS NOT NULL
expression. Read moresourceยงfn is_null(self) -> SimpleExpr
fn is_null(self) -> SimpleExpr
Express a
IS NULL
expression. Read moresourceยงfn left_shift<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
fn left_shift<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
Express a bitwise left shift. Read more
sourceยงfn like<L>(self, like: L) -> SimpleExprwhere
L: IntoLikeExpr,
fn like<L>(self, like: L) -> SimpleExprwhere
L: IntoLikeExpr,
Express a
LIKE
expression. Read moresourceยงfn lt<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
fn lt<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
Express a less than (
<
) expression. Read moresourceยงfn lte<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
fn lte<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
Express a less than or equal (
<=
) expression. Read moresourceยงfn modulo<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
fn modulo<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
Express an arithmetic modulo operation. Read more
sourceยงfn mul<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
fn mul<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
Express an arithmetic multiplication operation. Read more
sourceยงfn ne<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
fn ne<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
Express a not equal (
<>
) expression. Read moresourceยงfn not(self) -> SimpleExpr
fn not(self) -> SimpleExpr
Negates an expression with
NOT
. Read moresourceยงfn not_between<A, B>(self, a: A, b: B) -> SimpleExpr
fn not_between<A, B>(self, a: A, b: B) -> SimpleExpr
Express a
NOT BETWEEN
expression. Read moresourceยงfn not_equals<C>(self, col: C) -> SimpleExprwhere
C: IntoColumnRef,
fn not_equals<C>(self, col: C) -> SimpleExprwhere
C: IntoColumnRef,
Express a not equal expression between two table columns,
you will mainly use this to relate identical value between two table columns. Read more
sourceยงfn not_in_subquery(self, sel: SelectStatement) -> SimpleExpr
fn not_in_subquery(self, sel: SelectStatement) -> SimpleExpr
Express a
NOT IN
sub-query expression. Read moresourceยงfn not_like<L>(self, like: L) -> SimpleExprwhere
L: IntoLikeExpr,
fn not_like<L>(self, like: L) -> SimpleExprwhere
L: IntoLikeExpr,
Express a
NOT LIKE
expression. Read moresourceยงfn or<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
fn or<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
Express a logical
OR
operation. Read moresourceยงfn right_shift<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
fn right_shift<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
Express a bitwise right shift. Read more
sourceยงfn sub<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
fn sub<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
Express an arithmetic subtraction operation. Read more
sourceยงimpl<T> Instrument for T
impl<T> Instrument for T
sourceยงfn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourceยงfn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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