pub enum Value {
Bit(bool),
Tinyint(i8),
Smallint(i16),
Integer(i32),
Bigint(i64),
Float(f32),
Double(f64),
String(String),
Timestamp(SqlTimestamp),
Date(SqlDate),
Time(SqlSsTime2),
}
Expand description
Representation of every supported column value.
Variants§
Bit(bool)
Tinyint(i8)
Smallint(i16)
Integer(i32)
Bigint(i64)
Float(f32)
Double(f64)
String(String)
Timestamp(SqlTimestamp)
Date(SqlDate)
Time(SqlSsTime2)
Implementations§
source§impl Value
impl Value
Note that as_
methods return reference so values can be parameter-bound to a query.
Use to_
or into_
methods to get values cheaply.
pub fn as_bool(&self) -> Option<&bool>
pub fn to_bool(&self) -> Option<bool>
pub fn as_i8(&self) -> Option<&i8>
pub fn to_i8(&self) -> Option<i8>
pub fn as_i16(&self) -> Option<&i16>
pub fn to_i16(&self) -> Option<i16>
pub fn as_i32(&self) -> Option<&i32>
pub fn to_i32(&self) -> Option<i32>
pub fn as_i64(&self) -> Option<&i64>
pub fn to_i64(&self) -> Option<i64>
pub fn as_f32(&self) -> Option<&f32>
pub fn to_f32(&self) -> Option<f32>
pub fn as_f64(&self) -> Option<&f64>
pub fn to_f64(&self) -> Option<f64>
pub fn as_str(&self) -> Option<&str>
pub fn into_string(self) -> Result<String, Value>
pub fn as_timestamp(&self) -> Option<&SqlTimestamp>
pub fn into_timestamp(self) -> Result<SqlTimestamp, Value>
pub fn to_naive_date_time(&self) -> Option<NaiveDateTime>
pub fn as_date(&self) -> Option<&SqlDate>
pub fn into_date(self) -> Result<SqlDate, Value>
pub fn to_naive_date(&self) -> Option<NaiveDate>
pub fn as_time(&self) -> Option<&SqlSsTime2>
pub fn into_time(self) -> Result<SqlSsTime2, Value>
pub fn to_naive_time(&self) -> Option<NaiveTime>
sourcepub fn datum_type(&self) -> DatumType
pub fn datum_type(&self) -> DatumType
Type of this value.
Trait Implementations§
source§impl From<NaiveDateTime> for Value
impl From<NaiveDateTime> for Value
source§fn from(value: NaiveDateTime) -> Value
fn from(value: NaiveDateTime) -> Value
Converts to this type from the input type.
source§impl From<SQL_DATE_STRUCT> for Value
impl From<SQL_DATE_STRUCT> for Value
source§impl From<SQL_SS_TIME2_STRUCT> for Value
impl From<SQL_SS_TIME2_STRUCT> for Value
source§fn from(value: SqlSsTime2) -> Value
fn from(value: SqlSsTime2) -> Value
Converts to this type from the input type.
source§impl From<SQL_TIMESTAMP_STRUCT> for Value
impl From<SQL_TIMESTAMP_STRUCT> for Value
source§fn from(value: SqlTimestamp) -> Value
fn from(value: SqlTimestamp) -> Value
Converts to this type from the input type.
source§impl From<SQL_TIME_STRUCT> for Value
impl From<SQL_TIME_STRUCT> for Value
source§impl From<UnixTimestamp> for Value
impl From<UnixTimestamp> for Value
source§fn from(value: UnixTimestamp) -> Value
fn from(value: UnixTimestamp) -> Value
Converts to this type from the input type.