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>>)
Available on crate feature
with-json only.ChronoDate(Option<Box<NaiveDate>>)
Available on crate feature
with-chrono only.ChronoTime(Option<Box<NaiveTime>>)
Available on crate feature
with-chrono only.ChronoDateTime(Option<Box<NaiveDateTime>>)
Available on crate feature
with-chrono only.ChronoDateTimeUtc(Option<Box<DateTime<Utc>>>)
Available on crate feature
with-chrono only.ChronoDateTimeLocal(Option<Box<DateTime<Local>>>)
Available on crate feature
with-chrono only.ChronoDateTimeWithTimeZone(Option<Box<DateTime<FixedOffset>>>)
Available on crate feature
with-chrono only.TimeDate(Option<Box<Date>>)
Available on crate feature
with-time only.TimeTime(Option<Box<Time>>)
Available on crate feature
with-time only.TimeDateTime(Option<Box<PrimitiveDateTime>>)
Available on crate feature
with-time only.TimeDateTimeWithTimeZone(Option<Box<OffsetDateTime>>)
Available on crate feature
with-time only.Uuid(Option<Box<Uuid>>)
Available on crate feature
with-uuid only.Decimal(Option<Box<Decimal>>)
Available on crate feature
with-rust_decimal only.BigDecimal(Option<Box<BigDecimal>>)
Available on crate feature
with-bigdecimal only.Array(ArrayType, Option<Box<Vec<Value>>>)
Available on crate feature
postgres-array only.Implementationsยง
Sourceยงimpl Value
impl Value
pub fn unwrap<T>(self) -> Twhere
T: ValueType,
pub fn expect<T>(self, msg: &str) -> Twhere
T: ValueType,
Sourcepub fn as_null(&self) -> Value
pub fn as_null(&self) -> Value
Get the null variant of self
use sea_query::Value;
let v = Value::Int(Some(2));
let n = v.as_null();
assert_eq!(n, Value::Int(None));
// one liner:
assert_eq!(Into::<Value>::into(2.2).as_null(), Value::Double(None));Sourcepub fn dummy_value(&self) -> Value
pub fn dummy_value(&self) -> Value
Get a default value of selfโs type
use sea_query::Value;
let v = Value::Int(None);
let n = v.dummy_value();
assert_eq!(n, Value::Int(Some(0)));Sourceยงimpl Value
impl Value
pub fn is_chrono_date(&self) -> bool
Available on crate feature
with-chrono only.pub fn as_ref_chrono_date(&self) -> Option<&NaiveDate>
Available on crate feature
with-chrono only.Sourceยงimpl Value
impl Value
pub fn is_time_date(&self) -> bool
Available on crate feature
with-time only.pub fn as_ref_time_date(&self) -> Option<&Date>
Available on crate feature
with-time only.Sourceยงimpl Value
impl Value
pub fn is_chrono_time(&self) -> bool
Available on crate feature
with-chrono only.pub fn as_ref_chrono_time(&self) -> Option<&NaiveTime>
Available on crate feature
with-chrono only.Sourceยงimpl Value
impl Value
pub fn is_time_time(&self) -> bool
Available on crate feature
with-time only.pub fn as_ref_time_time(&self) -> Option<&Time>
Available on crate feature
with-time only.Sourceยงimpl Value
impl Value
pub fn is_chrono_date_time(&self) -> bool
Available on crate feature
with-chrono only.pub fn as_ref_chrono_date_time(&self) -> Option<&NaiveDateTime>
Available on crate feature
with-chrono only.Sourceยงimpl Value
impl Value
pub fn is_time_date_time(&self) -> bool
Available on crate feature
with-time only.pub fn as_ref_time_date_time(&self) -> Option<&PrimitiveDateTime>
Available on crate feature
with-time only.Sourceยงimpl Value
impl Value
pub fn is_chrono_date_time_utc(&self) -> bool
Available on crate feature
with-chrono only.pub fn as_ref_chrono_date_time_utc(&self) -> Option<&DateTime<Utc>>
Available on crate feature
with-chrono only.Sourceยงimpl Value
impl Value
pub fn is_chrono_date_time_local(&self) -> bool
Available on crate feature
with-chrono only.pub fn as_ref_chrono_date_time_local(&self) -> Option<&DateTime<Local>>
Available on crate feature
with-chrono only.Sourceยงimpl Value
impl Value
pub fn is_chrono_date_time_with_time_zone(&self) -> bool
Available on crate feature
with-chrono only.pub fn as_ref_chrono_date_time_with_time_zone( &self, ) -> Option<&DateTime<FixedOffset>>
Available on crate feature
with-chrono only.Sourceยงimpl Value
impl Value
pub fn is_time_date_time_with_time_zone(&self) -> bool
Available on crate feature
with-time only.pub fn as_ref_time_date_time_with_time_zone(&self) -> Option<&OffsetDateTime>
Available on crate feature
with-time only.Sourceยงimpl Value
impl Value
pub fn chrono_as_naive_utc_in_string(&self) -> Option<String>
Available on crate feature
with-chrono only.Sourceยงimpl Value
impl Value
pub fn time_as_naive_utc_in_string(&self) -> Option<String>
Available on crate feature
with-time only.Sourceยงimpl Value
impl Value
pub fn is_decimal(&self) -> bool
Available on crate feature
with-rust_decimal only.pub fn as_ref_decimal(&self) -> Option<&Decimal>
Available on crate feature
with-rust_decimal only.pub fn decimal_to_f64(&self) -> Option<f64>
Available on crate feature
with-rust_decimal only.Sourceยงimpl Value
impl Value
pub fn is_big_decimal(&self) -> bool
Available on crate feature
with-bigdecimal only.pub fn as_ref_big_decimal(&self) -> Option<&BigDecimal>
Available on crate feature
with-bigdecimal only.pub fn big_decimal_to_f64(&self) -> Option<f64>
Available on crate feature
with-bigdecimal only.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::concatenateSourceยง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ยง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ยงfn bit_and<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
fn bit_and<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
Express a bitwise AND operation. Read more
Sourceยงfn bit_or<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
fn bit_or<R>(self, right: R) -> SimpleExprwhere
R: Into<SimpleExpr>,
Express a bitwise OR 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