Enum scylla_cql::frame::response::result::CqlValue

source ·
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_cql_timestamp(&self) -> Option<CqlTimestamp>

source

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

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

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

impl<'frame, 'metadata> DeserializeValue<'frame, 'metadata> for CqlValue

source§

fn type_check(_typ: &ColumnType<'_>) -> Result<(), TypeCheckError>

Checks that the column type matches what this type expects.
source§

fn deserialize( typ: &'metadata ColumnType<'metadata>, v: Option<FrameSlice<'frame>>, ) -> Result<Self, DeserializationError>

Deserialize a column value from given serialized representation. Read more
source§

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

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

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

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

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

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

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

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

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

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

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

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

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

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

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

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

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

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

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

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
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§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
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§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
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§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
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§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
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§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
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§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
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§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

impl<K: FromCqlVal<CqlValue> + Ord, V: FromCqlVal<CqlValue>> FromCqlVal<CqlValue> for BTreeMap<K, V>

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

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

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

impl FromCqlVal<CqlValue> for Counter

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

impl FromCqlVal<CqlValue> for CqlDate

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

impl FromCqlVal<CqlValue> for CqlDecimal

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

impl FromCqlVal<CqlValue> for CqlDuration

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

impl FromCqlVal<CqlValue> for CqlTime

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

impl FromCqlVal<CqlValue> for CqlTimestamp

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

impl FromCqlVal<CqlValue> for CqlTimeuuid

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

impl FromCqlVal<CqlValue> for CqlValue

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

impl FromCqlVal<CqlValue> for CqlVarint

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

impl<T1: FromCqlVal<CqlValue> + Eq + Hash, T2: FromCqlVal<CqlValue>, T3: BuildHasher + Default> FromCqlVal<CqlValue> for HashMap<T1, T2, T3>

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

impl<T: FromCqlVal<CqlValue> + Eq + Hash, S: BuildHasher + Default> FromCqlVal<CqlValue> for HashSet<T, S>

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

impl FromCqlVal<CqlValue> for IpAddr

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

impl FromCqlVal<CqlValue> for String

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

impl FromCqlVal<CqlValue> for Uuid

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

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

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

impl FromCqlVal<CqlValue> for Vec<u8>

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

impl FromCqlVal<CqlValue> for bool

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

impl FromCqlVal<CqlValue> for f32

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

impl FromCqlVal<CqlValue> for f64

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

impl FromCqlVal<CqlValue> for i16

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

impl FromCqlVal<CqlValue> for i32

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

impl FromCqlVal<CqlValue> for i64

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
source§

impl FromCqlVal<CqlValue> for i8

source§

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

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
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 SerializeValue 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>

👎Deprecated since 0.15.1: Legacy serialization API is not type-safe and is going to be removed soon
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> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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§

fn from_cql(cql_val_opt: Option<CqlValue>) -> Result<T, FromCqlValError>

👎Deprecated since 0.15.0: Legacy deserialization API is inefficient and is going to be removed soon
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> Same for T

§

type Output = T

Should always be Self
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.
source§

impl<T> ErasedDestructor for T
where T: 'static,