pub enum CqlValue {
Show 26 variants Ascii(String), Boolean(bool), Blob(Vec<u8>), Counter(Counter), Decimal(BigDecimal), 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(Uuid), Tuple(Vec<Option<CqlValue>>), Uuid(Uuid), Varint(BigInt),
}

Variants§

§

Ascii(String)

§

Boolean(bool)

§

Blob(Vec<u8>)

§

Counter(Counter)

§

Decimal(BigDecimal)

§

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(Uuid)

§

Tuple(Vec<Option<CqlValue>>)

§

Uuid(Uuid)

§

Varint(BigInt)

Implementations§

§

impl CqlValue

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pub fn into_varint(self) -> Option<BigInt>

pub fn into_decimal(self) -> Option<BigDecimal>

Trait Implementations§

§

impl Clone for CqlValue

§

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
§

impl Debug for CqlValue

§

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

Formats the value using the given formatter. Read more
§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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)

§

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)

§

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)

§

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)

§

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)

§

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)

§

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

§

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

§

impl FromCqlVal<CqlValue> for BigDecimal

§

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

§

impl FromCqlVal<CqlValue> for BigInt

§

impl FromCqlVal<CqlValue> for Counter

§

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

§

impl FromCqlVal<CqlValue> for CqlDate

§

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

§

impl FromCqlVal<CqlValue> for CqlDuration

§

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

§

impl FromCqlVal<CqlValue> for CqlTime

§

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

§

impl FromCqlVal<CqlValue> for CqlTimestamp

§

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

§

impl FromCqlVal<CqlValue> for CqlValue

§

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

§

fn from_cql(cql_val: CqlValue) -> Result<HashMap<T1, T2, T3>, FromCqlValError>

§

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

§

impl FromCqlVal<CqlValue> for IpAddr

§

impl FromCqlVal<CqlValue> for String

§

impl FromCqlVal<CqlValue> for Uuid

§

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

§

impl FromCqlVal<CqlValue> for Vec<u8>

§

impl FromCqlVal<CqlValue> for bool

§

impl FromCqlVal<CqlValue> for f32

§

impl FromCqlVal<CqlValue> for f64

§

impl FromCqlVal<CqlValue> for i16

§

impl FromCqlVal<CqlValue> for i32

§

impl FromCqlVal<CqlValue> for i64

§

impl FromCqlVal<CqlValue> for i8

§

impl PartialEq for CqlValue

§

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

impl SerializeCql for CqlValue

§

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

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

impl ToCqlVal for CqlValue

§

impl Value for CqlValue

§

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

§

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.

§

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

§

impl<T> Instrument for T

§

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

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

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

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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