Value

Enum Value 

Source
pub enum Value {
Show 50 variants UInt8(u8), UInt16(u16), UInt32(u32), UInt64(u64), UInt128(u128), UInt256([u128; 2]), Int8(i8), Int16(i16), Int32(i32), Int64(i64), Int128(i128), Int256([i128; 2]), Float32(f32), Float64(f64), Bool(bool), String(String), UUID([u8; 16]), Date(u16), Date32(i32), DateTime(u32), DateTime64(i64), Enum8(i8), Enum16(i16), Array(Vec<Value>), Tuple(Vec<Value>), Map(HashMap<String, Value>), Nested(HashMap<String, Value>), NullableUInt8(Option<u8>), NullableUInt16(Option<u16>), NullableUInt32(Option<u32>), NullableUInt64(Option<u64>), NullableUInt128(Option<u128>), NullableUInt256(Option<[u128; 2]>), NullableInt8(Option<i8>), NullableInt16(Option<i16>), NullableInt32(Option<i32>), NullableInt64(Option<i64>), NullableInt128(Option<i128>), NullableInt256(Option<[i128; 2]>), NullableFloat32(Option<f32>), NullableFloat64(Option<f64>), NullableBool(Option<bool>), NullableString(Option<String>), NullableUUID(Option<[u8; 16]>), NullableDate(Option<u16>), NullableDate32(Option<i32>), NullableDateTime(Option<u32>), NullableDateTime64(Option<i64>), NullableEnum8(Option<i8>), NullableEnum16(Option<i16>),
}
Expand description

Clickhouse field value

Variants§

§

UInt8(u8)

u8

§

UInt16(u16)

u16

§

UInt32(u32)

u32

§

UInt64(u64)

u64

§

UInt128(u128)

u128

§

UInt256([u128; 2])

u256

§

Int8(i8)

i8

§

Int16(i16)

i16

§

Int32(i32)

i32

§

Int64(i64)

i64

§

Int128(i128)

i128

§

Int256([i128; 2])

i256

§

Float32(f32)

f32

§

Float64(f64)

f64

§

Bool(bool)

bool

§

String(String)

string

§

UUID([u8; 16])

UUID

§

Date(u16)

Number of days since 01-01-1970

§

Date32(i32)

Number of days since 01-01-1970 (signed int)

§

DateTime(u32)

Number of seconds since 01-01-1970

§

DateTime64(i64)

Number of nanosecs since 01-01-1970

§

Enum8(i8)

Enum8

§

Enum16(i16)

Enum16

§

Array(Vec<Value>)

Array

§

Tuple(Vec<Value>)

Tuple

§

Map(HashMap<String, Value>)

Map

§

Nested(HashMap<String, Value>)

Nested

§

NullableUInt8(Option<u8>)

Nullable u8

§

NullableUInt16(Option<u16>)

Nullable u16

§

NullableUInt32(Option<u32>)

Nullable u32

§

NullableUInt64(Option<u64>)

Nullable u64

§

NullableUInt128(Option<u128>)

Nullable u128

§

NullableUInt256(Option<[u128; 2]>)

Nullable u256

§

NullableInt8(Option<i8>)

Nullable i8

§

NullableInt16(Option<i16>)

Nullable i16

§

NullableInt32(Option<i32>)

Nullable i32

§

NullableInt64(Option<i64>)

Nullable i64

§

NullableInt128(Option<i128>)

Nullable i128

§

NullableInt256(Option<[i128; 2]>)

Nullable i258

§

NullableFloat32(Option<f32>)

Nullable f32

§

NullableFloat64(Option<f64>)

Nullable f64

§

NullableBool(Option<bool>)

Nullable bool

§

NullableString(Option<String>)

Nullable string

§

NullableUUID(Option<[u8; 16]>)

Nullable UUID

§

NullableDate(Option<u16>)

Nullable date

§

NullableDate32(Option<i32>)

Nullable date32

§

NullableDateTime(Option<u32>)

Nullable datetime

§

NullableDateTime64(Option<i64>)

Nullable datetime64

§

NullableEnum8(Option<i8>)

Nullable Enum8

§

NullableEnum16(Option<i16>)

Nullable Enum16

Implementations§

Source§

impl Value

Source

pub fn to_bytes(self, format: Format) -> Vec<u8>

Serializes a Value to bytes

Source

pub fn from_bytes( bytes: &[u8], format: Format, ty: Type, ) -> Result<Value, Error>

Deserializes a buffer to a Value

Source§

impl Value

Source

pub fn to_sql_string(&self) -> String

Converts a Value to a SQL string

Source§

impl Value

Source

pub fn try_into<T>(self) -> Result<T, Error>
where T: ChValue,

Tries to convert a Value into a specific type T

Source

pub fn is_same_type_as(&self, ty: &Type) -> bool

Checks if a Value corresponds to a type

Trait Implementations§

Source§

impl Clone for Value

Source§

fn clone(&self) -> Value

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Value

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Value

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> From<T> for Value
where T: ChValue,

Source§

fn from(value: T) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Value

Source§

fn eq(&self, other: &Value) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more