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
Note that as_
methods return reference so values can be parameter-bound to a query.
Use to_
or into_
methods to get values cheaply.
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.
Source§impl<C: Configuration> TryFromColumn<C> for Value
impl<C: Configuration> TryFromColumn<C> for Value
type Error = ColumnConvertError
Source§impl TryFromValue for Value
impl TryFromValue for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
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> ToErrorNoContext<T> for T
impl<T> ToErrorNoContext<T> for T
fn to_root_cause(self) -> ErrorNoContext<T>
Source§impl<T> TryFromRow<DefaultConfiguration> for Twhere
T: TryFromColumn<DefaultConfiguration>,
impl<T> TryFromRow<DefaultConfiguration> for Twhere
T: TryFromColumn<DefaultConfiguration>,
type Error = RowConvertError
Source§fn try_from_row<'r, 's, 'c, S>(
row: Row<'r, 's, 'c, S, DefaultConfiguration>,
) -> Result<T, <T as TryFromRow<DefaultConfiguration>>::Error>
fn try_from_row<'r, 's, 'c, S>( row: Row<'r, 's, 'c, S, DefaultConfiguration>, ) -> Result<T, <T as TryFromRow<DefaultConfiguration>>::Error>
Given
ColumnType
convert from Row
to other type of value representing table row.Source§impl<T> TryFromValueRow for Twhere
T: TryFromValue,
impl<T> TryFromValueRow for Twhere
T: TryFromValue,
type Error = ValueRowConvertError
Source§fn try_from_value_row(
values: Vec<Option<Value>>,
) -> Result<T, <T as TryFromValueRow>::Error>
fn try_from_value_row( values: Vec<Option<Value>>, ) -> Result<T, <T as TryFromValueRow>::Error>
Convert from
ValueRow
to other type of value representing table row.