pub enum Datum {
}Expand description
One value. Null has no type.
Variants§
Null
SQL NULL.
Bool(bool)
bool.
Int2(i16)
int2.
Int4(i32)
int4.
Int8(i64)
int8.
Float4(f32)
float4.
Float8(f64)
float8.
Oid(Oid)
oid.
Text(String)
text.
Bytea(Vec<u8>)
bytea.
Uuid([u8; 16])
uuid, the 16 bytes in the order of the text form.
Date(i32)
date, the days since 1 January 2000. i32::MAX is infinity and i32::MIN is -infinity.
Timestamp(i64)
timestamp, the microseconds since 1 January 2000. i64::MAX is infinity and i64::MIN is -infinity.
TimestampTz(i64)
timestamptz, the microseconds since 1 January 2000 UTC, with the infinities of timestamp.
Implementations§
Source§impl Datum
impl Datum
Sourcepub fn decode(ty: TypeId, bytes: Option<&[u8]>) -> Result<Datum>
pub fn decode(ty: TypeId, bytes: Option<&[u8]>) -> Result<Datum>
The value of type ty in the storage form bytes. None is Null. A storage form of the wrong length, a bool that is not 0 or 1, or text that is not UTF-8 gives SQLSTATE XX001, because only the engine writes the storage form. A type that M1 does not store gives XX000.
Trait Implementations§
impl StructuralPartialEq for Datum
Auto Trait Implementations§
impl Freeze for Datum
impl RefUnwindSafe for Datum
impl Send for Datum
impl Sync for Datum
impl Unpin for Datum
impl UnsafeUnpin for Datum
impl UnwindSafe for Datum
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