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 PartialEq for Value
impl PartialEq for Value
impl 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<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.