#[non_exhaustive]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,
name: String,
fields: Vec<(String, Option<CqlValue>)>,
},
SmallInt(i16),
TinyInt(i8),
Time(CqlTime),
Timeuuid(CqlTimeuuid),
Tuple(Vec<Option<CqlValue>>),
Uuid(Uuid),
Varint(CqlVarint),
}
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future 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
SmallInt(i16)
TinyInt(i8)
Time(CqlTime)
Nanoseconds since midnight
Timeuuid(CqlTimeuuid)
Tuple(Vec<Option<CqlValue>>)
Uuid(Uuid)
Varint(CqlVarint)
Implementations§
Source§impl CqlValue
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<CqlTimeuuid>
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_cql_varint(self) -> Option<CqlVarint>
pub fn into_cql_decimal(self) -> Option<CqlDecimal>
Trait Implementations§
Source§impl<'frame, 'metadata> DeserializeValue<'frame, 'metadata> for CqlValue
impl<'frame, 'metadata> DeserializeValue<'frame, 'metadata> for CqlValue
Source§fn type_check(_typ: &ColumnType<'_>) -> Result<(), TypeCheckError>
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<CqlValue, DeserializationError>
fn deserialize( typ: &'metadata ColumnType<'metadata>, v: Option<FrameSlice<'frame>>, ) -> Result<CqlValue, DeserializationError>
Deserialize a column value from given serialized representation. Read more
Source§impl Display for CqlValue
Displays a CqlValue. The syntax should resemble the CQL literal syntax
(but no guarantee is given that it’s always the same).
impl Display for CqlValue
Displays a CqlValue. The syntax should resemble the CQL literal syntax (but no guarantee is given that it’s always the same).
Source§impl SerializeValue for CqlValue
impl SerializeValue for CqlValue
Source§fn serialize<'b>(
&self,
typ: &ColumnType<'_>,
writer: CellWriter<'b>,
) -> Result<WrittenCellProof<'b>, SerializationError>
fn serialize<'b>( &self, typ: &ColumnType<'_>, writer: CellWriter<'b>, ) -> Result<WrittenCellProof<'b>, SerializationError>
Serializes the value to given CQL type. Read more
impl StructuralPartialEq for CqlValue
Auto Trait Implementations§
impl Freeze for CqlValue
impl RefUnwindSafe for CqlValue
impl Send for CqlValue
impl Sync for CqlValue
impl Unpin for CqlValue
impl UnwindSafe for CqlValue
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more