Enum odbc_iter::Value

source ·
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.

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

pub fn as_str(&self) -> Option<&str>

source

pub fn into_string(self) -> Result<String, Value>

source

pub fn as_timestamp(&self) -> Option<&SqlTimestamp>

source

pub fn into_timestamp(self) -> Result<SqlTimestamp, Value>

source

pub fn to_naive_date_time(&self) -> Option<NaiveDateTime>

source

pub fn as_date(&self) -> Option<&SqlDate>

source

pub fn into_date(self) -> Result<SqlDate, Value>

source

pub fn to_naive_date(&self) -> Option<NaiveDate>

source

pub fn as_time(&self) -> Option<&SqlSsTime2>

source

pub fn into_time(self) -> Result<SqlSsTime2, Value>

source

pub fn to_naive_time(&self) -> Option<NaiveTime>

source

pub fn datum_type(&self) -> DatumType

Type of this value.

Trait Implementations§

source§

impl Clone for Value

source§

fn clone(&self) -> Value

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 Value

source§

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

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

impl Display for Value

source§

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

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

impl From<NaiveDate> for Value

source§

fn from(value: NaiveDate) -> Value

Converts to this type from the input type.
source§

impl From<NaiveDateTime> for Value

source§

fn from(value: NaiveDateTime) -> Value

Converts to this type from the input type.
source§

impl From<NaiveTime> for Value

source§

fn from(value: NaiveTime) -> Value

Converts to this type from the input type.
source§

impl From<SQL_DATE_STRUCT> for Value

source§

fn from(value: SqlDate) -> Value

Converts to this type from the input type.
source§

impl From<SQL_SS_TIME2_STRUCT> for Value

source§

fn from(value: SqlSsTime2) -> Value

Converts to this type from the input type.
source§

impl From<SQL_TIMESTAMP_STRUCT> for Value

source§

fn from(value: SqlTimestamp) -> Value

Converts to this type from the input type.
source§

impl From<SQL_TIME_STRUCT> for Value

source§

fn from(value: SqlTime) -> Value

Converts to this type from the input type.
source§

impl From<String> for Value

source§

fn from(value: String) -> Value

Converts to this type from the input type.
source§

impl From<UnixTimestamp> for Value

source§

fn from(value: UnixTimestamp) -> Value

Converts to this type from the input type.
source§

impl From<bool> for Value

source§

fn from(value: bool) -> Value

Converts to this type from the input type.
source§

impl From<f32> for Value

source§

fn from(value: f32) -> Value

Converts to this type from the input type.
source§

impl From<f64> for Value

source§

fn from(value: f64) -> Value

Converts to this type from the input type.
source§

impl From<i16> for Value

source§

fn from(value: i16) -> Value

Converts to this type from the input type.
source§

impl From<i32> for Value

source§

fn from(value: i32) -> Value

Converts to this type from the input type.
source§

impl From<i64> for Value

source§

fn from(value: i64) -> Value

Converts to this type from the input type.
source§

impl From<i8> for Value

source§

fn from(value: i8) -> Value

Converts to this type from the input type.
source§

impl PartialEq<Value> for Value

source§

fn eq(&self, other: &Value) -> 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<C: Configuration> TryFromColumn<C> for Value

§

type Error = ColumnConvertError

source§

fn try_from_column<'i, 's, 'c, S>( column: Column<'i, 's, 'c, S, C> ) -> Result<Self, Self::Error>

Create Self from row column.
source§

impl TryFromValue for Value

source§

impl StructuralPartialEq for Value

Auto Trait Implementations§

§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · 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> ToErrorNoContext<T> for T

source§

impl<T> ToOwned for Twhere 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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<E, C> WrapContext<C> for E

§

type ContextError = ErrorContext<E, C>

source§

fn wrap_context(self, context: C) -> ErrorContext<E, C>