pub enum PostgresValue {
Show 21 variants
Null,
Bool(bool),
Int2(i16),
Int4(i32),
Int8(i64),
Float4(f32),
Float8(f64),
Numeric(Decimal),
Text(String),
Varchar(String),
Char(String),
Uuid(Uuid),
Timestamp(NaiveDateTime),
TimestampTz(DateTime<Utc>),
Date(NaiveDate),
Time(NaiveTime),
Json(Value),
Jsonb(Value),
Array(Vec<PostgresValue>),
Composite(HashMap<String, PostgresValue>),
Bytea(Vec<u8>),
}Variants§
Null
Bool(bool)
Int2(i16)
Int4(i32)
Int8(i64)
Float4(f32)
Float8(f64)
Numeric(Decimal)
Text(String)
Varchar(String)
Char(String)
Uuid(Uuid)
Timestamp(NaiveDateTime)
TimestampTz(DateTime<Utc>)
Date(NaiveDate)
Time(NaiveTime)
Json(Value)
Jsonb(Value)
Array(Vec<PostgresValue>)
Composite(HashMap<String, PostgresValue>)
Bytea(Vec<u8>)
Implementations§
Source§impl PostgresValue
impl PostgresValue
pub fn to_json(&self) -> JsonValue
Sourcepub fn to_element_value(&self) -> ElementValue
pub fn to_element_value(&self) -> ElementValue
Converts this PostgresValue to an ElementValue.
Type mapping:
Timestamp->LocalDateTime,TimestampTz->ZonedDateTime(datetime types preserved).Numeric->Float(converted throughf64; precision may be lost for very large or high-precision values).Date,Time,Uuid->String.Json,Jsonb->String(JSON serialized as text).Composite,Bytea->String(via JSON representation fallback).- Other primitive scalar types map directly to their
ElementValuecounterparts.
Trait Implementations§
Source§impl Clone for PostgresValue
impl Clone for PostgresValue
Source§fn clone(&self) -> PostgresValue
fn clone(&self) -> PostgresValue
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PostgresValue
impl RefUnwindSafe for PostgresValue
impl Send for PostgresValue
impl Sync for PostgresValue
impl Unpin for PostgresValue
impl UnsafeUnpin for PostgresValue
impl UnwindSafe for PostgresValue
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