pub enum CqlValue {
Show 26 variants Ascii(String), Boolean(bool), Blob(Vec<u8>), Counter(Counter), Decimal(CqlDecimal), Date(CqlDate), Double(f64), Duration(CqlDuration), Empty, Float(f32), Int(i32), BigInt(i64), Text(String), Timestamp(CqlTimestamp), Inet(IpAddr), List(Vec<CqlValue>), Map(Vec<(CqlValue, CqlValue)>), Set(Vec<CqlValue>), UserDefinedType { keyspace: String, type_name: String, fields: Vec<(String, Option<CqlValue>)>, }, SmallInt(i16), TinyInt(i8), Time(CqlTime), Timeuuid(CqlTimeuuid), Tuple(Vec<Option<CqlValue>>), Uuid(Uuid), Varint(CqlVarint),
}

Variants§

§

Ascii(String)

§

Boolean(bool)

§

Blob(Vec<u8>)

§

Counter(Counter)

§

Decimal(CqlDecimal)

§

Date(CqlDate)

Days since -5877641-06-23 i.e. 2^31 days before unix epoch Can be converted to chrono::NaiveDate (-262145-1-1 to 262143-12-31) using as_date

§

Double(f64)

§

Duration(CqlDuration)

§

Empty

§

Float(f32)

§

Int(i32)

§

BigInt(i64)

§

Text(String)

§

Timestamp(CqlTimestamp)

Milliseconds since unix epoch

§

Inet(IpAddr)

§

List(Vec<CqlValue>)

§

Map(Vec<(CqlValue, CqlValue)>)

§

Set(Vec<CqlValue>)

§

UserDefinedType

Fields

§keyspace: String
§type_name: String
§fields: Vec<(String, Option<CqlValue>)>

Order of fields vector must match the order of fields as defined in the UDT. The driver does not check it by itself, so incorrect data will be written if the order is wrong.

§

SmallInt(i16)

§

TinyInt(i8)

§

Time(CqlTime)

Nanoseconds since midnight

§

Timeuuid(CqlTimeuuid)

§

Tuple(Vec<Option<CqlValue>>)

§

Uuid(Uuid)

§

Varint(CqlVarint)

Implementations§

source§

impl CqlValue

source

pub fn as_ascii(&self) -> Option<&String>

source

pub fn as_cql_date(&self) -> Option<CqlDate>

source

pub fn as_naive_date(&self) -> Option<NaiveDate>

Available on crate feature chrono only.
source

pub fn as_date(&self) -> Option<Date>

Available on crate feature time only.
source

pub fn as_cql_timestamp(&self) -> Option<CqlTimestamp>

source

pub fn as_datetime(&self) -> Option<DateTime<Utc>>

Available on crate feature chrono only.
source

pub fn as_offset_date_time(&self) -> Option<OffsetDateTime>

Available on crate feature time only.
source

pub fn as_cql_time(&self) -> Option<CqlTime>

source

pub fn as_naive_time(&self) -> Option<NaiveTime>

Available on crate feature chrono only.
source

pub fn as_time(&self) -> Option<Time>

Available on crate feature time only.
source

pub fn as_cql_duration(&self) -> Option<CqlDuration>

source

pub fn as_counter(&self) -> Option<Counter>

source

pub fn as_boolean(&self) -> Option<bool>

source

pub fn as_double(&self) -> Option<f64>

source

pub fn as_uuid(&self) -> Option<Uuid>

source

pub fn as_float(&self) -> Option<f32>

source

pub fn as_int(&self) -> Option<i32>

source

pub fn as_bigint(&self) -> Option<i64>

source

pub fn as_tinyint(&self) -> Option<i8>

source

pub fn as_smallint(&self) -> Option<i16>

source

pub fn as_blob(&self) -> Option<&Vec<u8>>

source

pub fn as_text(&self) -> Option<&String>

source

pub fn as_timeuuid(&self) -> Option<CqlTimeuuid>

source

pub fn into_string(self) -> Option<String>

source

pub fn into_blob(self) -> Option<Vec<u8>>

source

pub fn as_inet(&self) -> Option<IpAddr>

source

pub fn as_list(&self) -> Option<&Vec<CqlValue>>

source

pub fn as_set(&self) -> Option<&Vec<CqlValue>>

source

pub fn as_map(&self) -> Option<&Vec<(CqlValue, CqlValue)>>

source

pub fn as_udt(&self) -> Option<&Vec<(String, Option<CqlValue>)>>

source

pub fn into_vec(self) -> Option<Vec<CqlValue>>

source

pub fn into_pair_vec(self) -> Option<Vec<(CqlValue, CqlValue)>>

source

pub fn into_udt_pair_vec(self) -> Option<Vec<(String, Option<CqlValue>)>>

source

pub fn into_cql_varint(self) -> Option<CqlVarint>

source

pub fn into_cql_decimal(self) -> Option<CqlDecimal>

Trait Implementations§

source§

impl Clone for CqlValue

source§

fn clone(&self) -> CqlValue

Returns a copy 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 CqlValue

source§

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

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

impl<const N: usize> FromCqlVal<CqlValue> for [u8; N]

source§

impl<T1> FromCqlVal<CqlValue> for (T1,)

source§

impl<T1, T2> FromCqlVal<CqlValue> for (T1, T2)

source§

impl<T1, T2, T3> FromCqlVal<CqlValue> for (T1, T2, T3)

source§

impl<T1, T2, T3, T4> FromCqlVal<CqlValue> for (T1, T2, T3, T4)

source§

impl<T1, T2, T3, T4, T5> FromCqlVal<CqlValue> for (T1, T2, T3, T4, T5)

source§

impl<T1, T2, T3, T4, T5, T6> FromCqlVal<CqlValue> for (T1, T2, T3, T4, T5, T6)

source§

impl<T1, T2, T3, T4, T5, T6, T7> FromCqlVal<CqlValue> for (T1, T2, T3, T4, T5, T6, T7)

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> FromCqlVal<CqlValue> for (T1, T2, T3, T4, T5, T6, T7, T8)

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9> FromCqlVal<CqlValue> for (T1, T2, T3, T4, T5, T6, T7, T8, T9)

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> FromCqlVal<CqlValue> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> FromCqlVal<CqlValue> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> FromCqlVal<CqlValue> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> FromCqlVal<CqlValue> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> FromCqlVal<CqlValue> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> FromCqlVal<CqlValue> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> FromCqlVal<CqlValue> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)

source§

impl<K, V> FromCqlVal<CqlValue> for BTreeMap<K, V>

source§

impl<T> FromCqlVal<CqlValue> for BTreeSet<T>
where T: FromCqlVal<CqlValue> + Ord,

source§

impl FromCqlVal<CqlValue> for BigDecimal

Available on crate feature bigdecimal-04 only.
source§

fn from_cql(cql_val: CqlValue) -> Result<BigDecimal, FromCqlValError>

source§

impl FromCqlVal<CqlValue> for BigInt

Available on crate feature num-bigint-03 only.
source§

impl FromCqlVal<CqlValue> for BigInt

Available on crate feature num-bigint-04 only.
source§

impl FromCqlVal<CqlValue> for Counter

source§

impl FromCqlVal<CqlValue> for CqlDate

source§

impl FromCqlVal<CqlValue> for CqlDecimal

source§

impl FromCqlVal<CqlValue> for CqlDuration

source§

impl FromCqlVal<CqlValue> for CqlTime

source§

impl FromCqlVal<CqlValue> for CqlTimestamp

source§

impl FromCqlVal<CqlValue> for CqlTimeuuid

source§

impl FromCqlVal<CqlValue> for CqlValue

source§

impl FromCqlVal<CqlValue> for CqlVarint

source§

impl FromCqlVal<CqlValue> for Date

Available on crate feature time only.
source§

impl FromCqlVal<CqlValue> for DateTime<Utc>

Available on crate feature chrono only.
source§

impl<T1, T2, T3> FromCqlVal<CqlValue> for HashMap<T1, T2, T3>

source§

impl<T, S> FromCqlVal<CqlValue> for HashSet<T, S>

source§

impl FromCqlVal<CqlValue> for IpAddr

source§

impl FromCqlVal<CqlValue> for NaiveDate

Available on crate feature chrono only.
source§

impl FromCqlVal<CqlValue> for NaiveTime

Available on crate feature chrono only.
source§

impl FromCqlVal<CqlValue> for OffsetDateTime

Available on crate feature time only.
source§

fn from_cql(cql_val: CqlValue) -> Result<OffsetDateTime, FromCqlValError>

source§

impl<V> FromCqlVal<CqlValue> for Secret<V>
where V: FromCqlVal<CqlValue> + Zeroize,

Available on crate feature secret only.
source§

impl FromCqlVal<CqlValue> for String

source§

impl FromCqlVal<CqlValue> for Time

Available on crate feature time only.
source§

impl FromCqlVal<CqlValue> for Uuid

source§

impl<T> FromCqlVal<CqlValue> for Vec<T>
where T: FromCqlVal<CqlValue>,

source§

impl FromCqlVal<CqlValue> for Vec<u8>

source§

impl FromCqlVal<CqlValue> for bool

source§

impl FromCqlVal<CqlValue> for f32

source§

impl FromCqlVal<CqlValue> for f64

source§

impl FromCqlVal<CqlValue> for i16

source§

impl FromCqlVal<CqlValue> for i32

source§

impl FromCqlVal<CqlValue> for i64

source§

impl FromCqlVal<CqlValue> for i8

source§

impl PartialEq for CqlValue

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl SerializeCql for CqlValue

source§

fn serialize<'b>( &self, typ: &ColumnType, writer: CellWriter<'b> ) -> Result<WrittenCellProof<'b>, SerializationError>

Serializes the value to given CQL type. Read more
source§

impl Value for CqlValue

source§

fn serialize(&self, buf: &mut Vec<u8>) -> Result<(), ValueTooBig>

source§

impl StructuralPartialEq for CqlValue

Auto Trait Implementations§

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromCqlVal<Option<CqlValue>> for T
where T: FromCqlVal<CqlValue>,

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,

§

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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

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