pub enum Value {
Show 26 variants
Null,
Bool(bool),
Int8(i8),
Int16(i16),
Int32(i32),
Int64(i64),
Float32(f32),
Float64(f64),
Decimal(Decimal),
String(String),
Bytes(Vec<u8>),
Date(NaiveDate),
Time(NaiveTime),
DateTime(NaiveDateTime),
DateTimeTz(DateTime<Utc>),
Uuid(Uuid),
Json(Value),
Array(Vec<Value>),
Interval(i64),
Bit(Vec<u8>),
Enum(String),
Geometry(Vec<u8>),
Geography(Vec<u8>),
Range {
lower: Option<Box<Value>>,
upper: Option<Box<Value>>,
lower_inclusive: bool,
upper_inclusive: bool,
},
Composite(HashMap<String, Value>),
Custom {
type_name: String,
data: Vec<u8>,
},
}Expand description
SQL value type that can hold any database value
Variants§
Null
SQL NULL
Bool(bool)
Boolean value
Int8(i8)
8-bit signed integer (TINYINT)
Int16(i16)
16-bit signed integer (SMALLINT)
Int32(i32)
32-bit signed integer (INTEGER)
Int64(i64)
64-bit signed integer (BIGINT)
Float32(f32)
32-bit floating point (REAL)
Float64(f64)
64-bit floating point (DOUBLE PRECISION)
Decimal(Decimal)
Arbitrary precision decimal (NUMERIC, DECIMAL)
String(String)
Text string (VARCHAR, TEXT, CHAR)
Bytes(Vec<u8>)
Binary data (BYTEA, BLOB, VARBINARY)
Date(NaiveDate)
Date without time (DATE)
Time(NaiveTime)
Time without date (TIME)
DateTime(NaiveDateTime)
Timestamp without timezone (TIMESTAMP)
DateTimeTz(DateTime<Utc>)
Timestamp with timezone (TIMESTAMPTZ)
Uuid(Uuid)
UUID
Json(Value)
JSON value
Array(Vec<Value>)
Array of values
Interval(i64)
Interval (stored as microseconds)
Bit(Vec<u8>)
Bit string
Enum(String)
Enum value (stored as string)
Geometry(Vec<u8>)
Geometry (WKB format)
Geography(Vec<u8>)
Geography (WKB format)
Range
Range type (e.g., int4range, tsrange)
Fields
Composite(HashMap<String, Value>)
Composite/row type
Custom
Custom type (vendor-specific)
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.
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