pub enum Value {
}Expand description
Database value type.
Implements custom JSON serialization for cross-language compatibility:
Decimal-> string (avoid precision loss)DateTime-> RFC3339 stringUuid-> hyphenated lowercase stringBytes-> base64 string
Variants§
Null
NULL value.
Bool(bool)
Boolean.
I32(i32)
32-bit integer.
I64(i64)
64-bit integer.
F64(f64)
64-bit float.
Decimal(Decimal)
Decimal number with arbitrary precision.
DateTime(NaiveDateTime)
Date and time (without timezone).
Uuid(Uuid)
UUID.
Json(Value)
JSON value.
String(String)
String.
Bytes(Vec<u8>)
Byte array.
Array(Vec<Value>)
Array of values (PostgreSQL native arrays).
Array2D(Vec<Vec<Value>>)
2D array of values (PostgreSQL multi-dimensional arrays).
Enum
A database enum value with its PostgreSQL type name.
Carries the variant string (e.g. "ADMIN") together with the
lowercase PG type name (e.g. "role") so that the PostgreSQL
dialect can emit the required explicit cast ($1::role).
All other backends treat this identically to Value::String.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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.
Source§impl From<Vec<NaiveDateTime>> for Value
impl From<Vec<NaiveDateTime>> for Value
Source§fn from(v: Vec<NaiveDateTime>) -> Self
fn from(v: Vec<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