pub enum Value {
Show 35 variants
Int8(i8),
Int16(i16),
Int32(i32),
Int64(i64),
Int128(i128),
Int256(i256),
UInt8(u8),
UInt16(u16),
UInt32(u32),
UInt64(u64),
UInt128(u128),
UInt256(u256),
Float32(f32),
Float64(f64),
Decimal32(usize, i32),
Decimal64(usize, i64),
Decimal128(usize, i128),
Decimal256(usize, i256),
String(Vec<u8>),
Uuid(Uuid),
Date(Date),
DateTime(DateTime),
DateTime64(DynDateTime64),
Enum8(i8),
Enum16(i16),
Array(Vec<Value>),
Tuple(Vec<Value>),
Null,
Map(Vec<Value>, Vec<Value>),
Ipv4(Ipv4),
Ipv6(Ipv6),
Point(Point),
Ring(Ring),
Polygon(Polygon),
MultiPolygon(MultiPolygon),
}Expand description
A raw Clickhouse value.
Types are not strictly/completely preserved (i.e. types String and FixedString both are value String).
Use this if you want dynamically typed queries.
Variants§
Int8(i8)
Int16(i16)
Int32(i32)
Int64(i64)
Int128(i128)
Int256(i256)
UInt8(u8)
UInt16(u16)
UInt32(u32)
UInt64(u64)
UInt128(u128)
UInt256(u256)
Float32(f32)
Float64(f64)
Decimal32(usize, i32)
Decimal64(usize, i64)
Decimal128(usize, i128)
Decimal256(usize, i256)
String(Vec<u8>)
Uuid(Uuid)
Date(Date)
DateTime(DateTime)
DateTime64(DynDateTime64)
Enum8(i8)
Enum16(i16)
Array(Vec<Value>)
Tuple(Vec<Value>)
Null
Map(Vec<Value>, Vec<Value>)
Ipv4(Ipv4)
Ipv6(Ipv6)
Point(Point)
Ring(Ring)
Polygon(Polygon)
MultiPolygon(MultiPolygon)
Implementations§
Source§impl Value
impl Value
pub fn string(value: impl Into<String>) -> Self
pub fn unwrap_array_ref(&self) -> &[Value]
pub fn unwrap_array(self) -> Vec<Value>
pub fn unwrap_tuple(self) -> Vec<Value>
pub fn unarray(self) -> Option<Vec<Value>>
Sourcepub fn to_value<T: FromSql>(self, type_: &Type) -> Result<T>
pub fn to_value<T: FromSql>(self, type_: &Type) -> Result<T>
Converts a Value to a [T] type by calling [T::from_sql].
Sourcepub fn from_value<T: ToSql>(value: T) -> Result<Self>
pub fn from_value<T: ToSql>(value: T) -> Result<Self>
Converts a [T] type to a Value by calling [T::to_sql].
Sourcepub fn guess_type(&self) -> Type
pub fn guess_type(&self) -> Type
Guesses a Type from the value, may not correspond to actual column type in Clickhouse
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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<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§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.