pub enum Value {
Show 31 variants
Bool(Option<bool>),
TinyInt(Option<i8>),
SmallInt(Option<i16>),
Int(Option<i32>),
BigInt(Option<i64>),
TinyUnsigned(Option<u8>),
SmallUnsigned(Option<u16>),
Unsigned(Option<u32>),
BigUnsigned(Option<u64>),
Float(Option<f32>),
Double(Option<f64>),
String(Option<Box<String>>),
Char(Option<char>),
Bytes(Option<Box<Vec<u8>>>),
Json(Option<Box<Json>>),
ChronoDate(Option<Box<NaiveDate>>),
ChronoTime(Option<Box<NaiveTime>>),
ChronoDateTime(Option<Box<NaiveDateTime>>),
ChronoDateTimeUtc(Option<Box<DateTime<Utc>>>),
ChronoDateTimeLocal(Option<Box<DateTime<Local>>>),
ChronoDateTimeWithTimeZone(Option<Box<DateTime<FixedOffset>>>),
TimeDate(Option<Box<Date>>),
TimeTime(Option<Box<Time>>),
TimeDateTime(Option<Box<PrimitiveDateTime>>),
TimeDateTimeWithTimeZone(Option<Box<OffsetDateTime>>),
Uuid(Option<Box<Uuid>>),
Decimal(Option<Box<Decimal>>),
BigDecimal(Option<Box<BigDecimal>>),
Array(ArrayType, Option<Box<Vec<Value>>>),
IpNetwork(Option<Box<IpNetwork>>),
MacAddress(Option<Box<MacAddress>>),
}
Expand description
Value variants
We want Value to be exactly 1 pointer sized, so anything larger should be boxed.
Variantsยง
Bool(Option<bool>)
TinyInt(Option<i8>)
SmallInt(Option<i16>)
Int(Option<i32>)
BigInt(Option<i64>)
TinyUnsigned(Option<u8>)
SmallUnsigned(Option<u16>)
Unsigned(Option<u32>)
BigUnsigned(Option<u64>)
Float(Option<f32>)
Double(Option<f64>)
String(Option<Box<String>>)
Char(Option<char>)
Bytes(Option<Box<Vec<u8>>>)
Json(Option<Box<Json>>)
Available on crate feature
with-json
only.ChronoDate(Option<Box<NaiveDate>>)
Available on crate feature
with-chrono
only.ChronoTime(Option<Box<NaiveTime>>)
Available on crate feature
with-chrono
only.ChronoDateTime(Option<Box<NaiveDateTime>>)
Available on crate feature
with-chrono
only.ChronoDateTimeUtc(Option<Box<DateTime<Utc>>>)
Available on crate feature
with-chrono
only.ChronoDateTimeLocal(Option<Box<DateTime<Local>>>)
Available on crate feature
with-chrono
only.ChronoDateTimeWithTimeZone(Option<Box<DateTime<FixedOffset>>>)
Available on crate feature
with-chrono
only.TimeDate(Option<Box<Date>>)
Available on crate feature
with-time
only.TimeTime(Option<Box<Time>>)
Available on crate feature
with-time
only.TimeDateTime(Option<Box<PrimitiveDateTime>>)
Available on crate feature
with-time
only.TimeDateTimeWithTimeZone(Option<Box<OffsetDateTime>>)
Available on crate feature
with-time
only.Uuid(Option<Box<Uuid>>)
Available on crate feature
with-uuid
only.Decimal(Option<Box<Decimal>>)
Available on crate feature
with-rust_decimal
only.BigDecimal(Option<Box<BigDecimal>>)
Available on crate feature
with-bigdecimal
only.Array(ArrayType, Option<Box<Vec<Value>>>)
Available on crate feature
postgres-array
only.IpNetwork(Option<Box<IpNetwork>>)
Available on crate feature
with-ipnetwork
only.MacAddress(Option<Box<MacAddress>>)
Available on crate feature
with-mac_address
only.Implementationsยง
sourceยงimpl Value
impl Value
pub fn is_chrono_date(&self) -> bool
pub fn as_ref_chrono_date(&self) -> Option<&NaiveDate>
sourceยงimpl Value
impl Value
pub fn is_time_date(&self) -> bool
pub fn as_ref_time_date(&self) -> Option<&Date>
sourceยงimpl Value
impl Value
pub fn is_chrono_time(&self) -> bool
pub fn as_ref_chrono_time(&self) -> Option<&NaiveTime>
sourceยงimpl Value
impl Value
pub fn is_time_time(&self) -> bool
pub fn as_ref_time_time(&self) -> Option<&Time>
sourceยงimpl Value
impl Value
pub fn is_chrono_date_time(&self) -> bool
pub fn as_ref_chrono_date_time(&self) -> Option<&NaiveDateTime>
sourceยงimpl Value
impl Value
pub fn is_time_date_time(&self) -> bool
pub fn as_ref_time_date_time(&self) -> Option<&PrimitiveDateTime>
sourceยงimpl Value
impl Value
pub fn is_chrono_date_time_utc(&self) -> bool
pub fn as_ref_chrono_date_time_utc(&self) -> Option<&DateTime<Utc>>
sourceยงimpl Value
impl Value
pub fn is_chrono_date_time_local(&self) -> bool
pub fn as_ref_chrono_date_time_local(&self) -> Option<&DateTime<Local>>
sourceยงimpl Value
impl Value
pub fn is_chrono_date_time_with_time_zone(&self) -> bool
pub fn as_ref_chrono_date_time_with_time_zone(
&self
) -> Option<&DateTime<FixedOffset>>
sourceยงimpl Value
impl Value
pub fn is_time_date_time_with_time_zone(&self) -> bool
pub fn as_ref_time_date_time_with_time_zone(&self) -> Option<&OffsetDateTime>
sourceยงimpl Value
impl Value
pub fn is_decimal(&self) -> bool
pub fn as_ref_decimal(&self) -> Option<&Decimal>
pub fn decimal_to_f64(&self) -> Option<f64>
sourceยงimpl Value
impl Value
pub fn is_big_decimal(&self) -> bool
pub fn as_ref_big_decimal(&self) -> Option<&BigDecimal>
pub fn big_decimal_to_f64(&self) -> Option<f64>
sourceยงimpl Value
impl Value
pub fn is_mac_address(&self) -> bool
pub fn as_ref_mac_address(&self) -> Option<&MacAddress>
Trait Implementationsยง
sourceยงimpl From<BigDecimal> for Value
Available on crate feature with-bigdecimal
only.
impl From<BigDecimal> for Value
Available on crate feature
with-bigdecimal
only.sourceยงfn from(x: BigDecimal) -> Value
fn from(x: BigDecimal) -> Value
Converts to this type from the input type.
sourceยงimpl From<MacAddress> for Value
Available on crate feature with-mac_address
only.
impl From<MacAddress> for Value
Available on crate feature
with-mac_address
only.sourceยงfn from(x: MacAddress) -> Value
fn from(x: MacAddress) -> Value
Converts to this type from the input type.
sourceยงimpl From<NaiveDateTime> for Value
Available on crate feature with-chrono
only.
impl From<NaiveDateTime> for Value
Available on crate feature
with-chrono
only.sourceยงfn from(x: NaiveDateTime) -> Value
fn from(x: NaiveDateTime) -> Value
Converts to this type from the input type.
sourceยงimpl From<OffsetDateTime> for Value
Available on crate feature with-time
only.
impl From<OffsetDateTime> for Value
Available on crate feature
with-time
only.sourceยงfn from(v: OffsetDateTime) -> Value
fn from(v: OffsetDateTime) -> Value
Converts to this type from the input type.
sourceยงimpl From<PrimitiveDateTime> for Value
Available on crate feature with-time
only.
impl From<PrimitiveDateTime> for Value
Available on crate feature
with-time
only.sourceยงfn from(x: PrimitiveDateTime) -> Value
fn from(x: PrimitiveDateTime) -> Value
Converts to this type from the input type.
sourceยงimpl<T> From<Vec<T, Global>> for Valuewhere
T: Into<Value> + NotU8 + ValueType,
Available on crate feature postgres-array
only.
impl<T> From<Vec<T, Global>> for Valuewhere
T: Into<Value> + NotU8 + ValueType,
Available on crate feature
postgres-array
only.