pub enum Value {
Show 28 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>>),
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(Option<Box<Vec<Value>>>),
}
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>>)
Bytes(Option<Box<Vec<u8>>>)
Json(Option<Box<Json>>)
with-json
only.ChronoDate(Option<Box<NaiveDate>>)
with-chrono
only.ChronoTime(Option<Box<NaiveTime>>)
with-chrono
only.ChronoDateTime(Option<Box<NaiveDateTime>>)
with-chrono
only.ChronoDateTimeUtc(Option<Box<DateTime<Utc>>>)
with-chrono
only.ChronoDateTimeLocal(Option<Box<DateTime<Local>>>)
with-chrono
only.ChronoDateTimeWithTimeZone(Option<Box<DateTime<FixedOffset>>>)
with-chrono
only.TimeDate(Option<Box<Date>>)
with-time
only.TimeTime(Option<Box<Time>>)
with-time
only.TimeDateTime(Option<Box<PrimitiveDateTime>>)
with-time
only.TimeDateTimeWithTimeZone(Option<Box<OffsetDateTime>>)
with-time
only.Uuid(Option<Box<Uuid>>)
with-uuid
only.Decimal(Option<Box<Decimal>>)
with-rust_decimal
only.BigDecimal(Option<Box<BigDecimal>>)
with-bigdecimal
only.Array(Option<Box<Vec<Value>>>)
postgres-array
only.Implementations
sourceimpl Value
impl Value
pub fn is_chrono_date(&self) -> bool
pub fn as_ref_chrono_date(&self) -> Option<&NaiveDate>
sourceimpl Value
impl Value
pub fn is_time_date(&self) -> bool
pub fn as_ref_time_date(&self) -> Option<&Date>
sourceimpl Value
impl Value
pub fn is_chrono_time(&self) -> bool
pub fn as_ref_chrono_time(&self) -> Option<&NaiveTime>
sourceimpl Value
impl Value
pub fn is_time_time(&self) -> bool
pub fn as_ref_time_time(&self) -> Option<&Time>
sourceimpl Value
impl Value
pub fn is_chrono_date_time(&self) -> bool
pub fn as_ref_chrono_date_time(&self) -> Option<&NaiveDateTime>
sourceimpl Value
impl Value
pub fn is_time_date_time(&self) -> bool
pub fn as_ref_time_date_time(&self) -> Option<&PrimitiveDateTime>
sourceimpl Value
impl Value
pub fn is_chrono_date_time_utc(&self) -> bool
pub fn as_ref_chrono_date_time_utc(&self) -> Option<&DateTime<Utc>>
sourceimpl Value
impl Value
pub fn is_chrono_date_time_local(&self) -> bool
pub fn as_ref_chrono_date_time_local(&self) -> Option<&DateTime<Local>>
sourceimpl 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>>
sourceimpl 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>
sourceimpl 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>
sourceimpl 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>
Trait Implementations
sourceimpl From<BigDecimal> for Value
Available on crate feature with-bigdecimal
only.
impl From<BigDecimal> for Value
with-bigdecimal
only.sourcefn from(x: BigDecimal) -> Value
fn from(x: BigDecimal) -> Value
Converts to this type from the input type.
sourceimpl From<DateTime<FixedOffset>> for Value
Available on crate feature with-chrono
only.
impl From<DateTime<FixedOffset>> for Value
with-chrono
only.sourcefn from(x: DateTime<FixedOffset>) -> Value
fn from(x: DateTime<FixedOffset>) -> Value
Converts to this type from the input type.
sourceimpl From<NaiveDateTime> for Value
Available on crate feature with-chrono
only.
impl From<NaiveDateTime> for Value
with-chrono
only.sourcefn from(x: NaiveDateTime) -> Value
fn from(x: NaiveDateTime) -> Value
Converts to this type from the input type.
sourceimpl From<OffsetDateTime> for Value
Available on crate feature with-time
only.
impl From<OffsetDateTime> for Value
with-time
only.sourcefn from(v: OffsetDateTime) -> Value
fn from(v: OffsetDateTime) -> Value
Converts to this type from the input type.
sourceimpl From<PrimitiveDateTime> for Value
Available on crate feature with-time
only.
impl From<PrimitiveDateTime> for Value
with-time
only.sourcefn from(x: PrimitiveDateTime) -> Value
fn from(x: PrimitiveDateTime) -> Value
Converts to this type from the input type.
sourceimpl<T> From<Vec<T, Global>> for Value where
T: Into<Value> + NotU8,
Available on crate feature postgres-array
only.
impl<T> From<Vec<T, Global>> for Value where
T: Into<Value> + NotU8,
postgres-array
only.sourceimpl ToSql for Value
impl ToSql for Value
sourcefn to_sql(
&self,
ty: &Type,
out: &mut BytesMut
) -> Result<IsNull, Box<dyn Error + Sync + Send>>
fn to_sql(
&self,
ty: &Type,
out: &mut BytesMut
) -> Result<IsNull, Box<dyn Error + Sync + Send>>
Converts the value of self
into the binary format of the specified
Postgres Type
, appending it to out
. Read more
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> BorrowToSql for T where
T: ToSql,
impl<T> BorrowToSql for T where
T: ToSql,
sourcefn borrow_to_sql(&self) -> &dyn ToSql
fn borrow_to_sql(&self) -> &dyn ToSql
Returns a reference to self
as a ToSql
trait object.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<V> IntoValueTuple for V where
V: Into<Value>,
impl<V> IntoValueTuple for V where
V: Into<Value>,
fn into_value_tuple(self) -> ValueTuple
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more