pub enum Value {
Show 30 variants
Short(i16),
Int(i32),
BigInt(i64),
Real(f32),
Double(f64),
Bool(bool),
String(String),
Bytes(Vec<u8>),
Uuid(Uuid),
DateTime(DateTime<Utc>),
NaiveDateTime(NaiveDateTime),
NaiveDate(NaiveDate),
NaiveTime(NaiveTime),
Json(Value),
Jsonb(Value),
OptionShort(Option<i16>),
OptionInt(Option<i32>),
OptionBigInt(Option<i64>),
OptionReal(Option<f32>),
OptionDouble(Option<f64>),
OptionBool(Option<bool>),
OptionString(Option<String>),
OptionBytes(Option<Vec<u8>>),
OptionUuid(Option<Uuid>),
OptionDateTime(Option<DateTime<Utc>>),
OptionNaiveDateTime(Option<NaiveDateTime>),
OptionNaiveDate(Option<NaiveDate>),
OptionNaiveTime(Option<NaiveTime>),
OptionJson(Option<Value>),
OptionJsonb(Option<Value>),
}Expand description
Represents a SQL parameter value with full type information.
§Design Decision: Typed Nulls
There is no generic Value::Null variant. Each nullable type has its own Option*
variant (e.g., OptionInt(Option<i32>)) so that PostgreSQL receives the correct
type OID even when the value is NULL.
Variants§
Short(i16)
Int(i32)
BigInt(i64)
Real(f32)
Double(f64)
Bool(bool)
String(String)
Bytes(Vec<u8>)
Uuid(Uuid)
DateTime(DateTime<Utc>)
NaiveDateTime(NaiveDateTime)
NaiveDate(NaiveDate)
NaiveTime(NaiveTime)
Json(Value)
Jsonb(Value)
OptionShort(Option<i16>)
OptionInt(Option<i32>)
OptionBigInt(Option<i64>)
OptionReal(Option<f32>)
OptionDouble(Option<f64>)
OptionBool(Option<bool>)
OptionString(Option<String>)
OptionBytes(Option<Vec<u8>>)
OptionUuid(Option<Uuid>)
OptionDateTime(Option<DateTime<Utc>>)
OptionNaiveDateTime(Option<NaiveDateTime>)
OptionNaiveDate(Option<NaiveDate>)
OptionNaiveTime(Option<NaiveTime>)
OptionJson(Option<Value>)
OptionJsonb(Option<Value>)
Trait Implementations§
Source§impl From<NaiveDateTime> for Value
impl From<NaiveDateTime> for Value
Source§fn from(v: NaiveDateTime) -> Self
fn from(v: NaiveDateTime) -> Self
Converts to this type from the input type.
Source§impl From<Option<NaiveDateTime>> for Value
impl From<Option<NaiveDateTime>> for Value
Source§fn from(v: Option<NaiveDateTime>) -> Self
fn from(v: Option<NaiveDateTime>) -> Self
Converts to this type from the input type.
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 UnsafeUnpin 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,
impl<T> FlozRowBound for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more