pub enum Value {
Show 16 variants
Null,
Integer(i64),
Real(f64),
Text(CompactString),
Blob(Vec<u8>),
Boolean(bool),
Time(i64),
Date(i32),
Timestamp(i64),
Interval {
months: i32,
days: i32,
micros: i64,
},
Json(CompactString),
Jsonb(Arc<[u8]>),
TsVector(Arc<[u8]>),
TsQuery(Arc<[u8]>),
Array(Arc<Vec<Value>>),
Vector(Arc<[f32]>),
}Expand description
SQL value. Temporal epochs: days/µs since 1970-01-01 UTC.
Date/Timestamp reserve i{32,64}::{MAX,MIN} as ±infinity sentinels.
Variants§
Null
Integer(i64)
Real(f64)
Text(CompactString)
Blob(Vec<u8>)
Boolean(bool)
Time(i64)
Date(i32)
Timestamp(i64)
Interval
Json(CompactString)
Jsonb(Arc<[u8]>)
TsVector(Arc<[u8]>)
TsQuery(Arc<[u8]>)
Array(Arc<Vec<Value>>)
Vector(Arc<[f32]>)
Implementations§
Source§impl Value
impl Value
pub fn data_type(&self) -> DataType
pub fn is_null(&self) -> bool
pub fn is_finite_temporal(&self) -> bool
pub fn coerce_to(&self, target: DataType) -> Option<Value>
pub fn coerce_into(self, target: DataType) -> Option<Value>
pub fn strict_coerce(&self, target: DataType) -> Option<Value>
Trait Implementations§
impl Eq for Value
Source§impl Ord for Value
impl Ord for Value
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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
Compare self to
key and return true if they are equal.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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more