pub struct PgValue {
pub value: Option<Vec<u8>>,
pub type_info: PgTypeInfo,
pub format: PgValueFormat,
pub timezone_sec: Option<i32>,
}Expand description
Implementation of [Value] for PostgreSQL.
Fields§
§value: Option<Vec<u8>>§type_info: PgTypeInfo§format: PgValueFormat§timezone_sec: Option<i32>Session timezone offset in seconds from UTC, used for TIMESTAMPTZ decoding
Implementations§
Source§impl PgValue
impl PgValue
pub fn get( buf: &mut &[u8], format: PgValueFormat, ty: PgTypeInfo, timezone_sec: Option<i32>, ) -> Self
pub fn as_ref(&self) -> PgValueRef<'_>
pub fn type_info(&self) -> Cow<'_, PgTypeInfo>
pub fn is_null(&self) -> bool
pub fn format(&self) -> PgValueFormat
pub fn as_str(&self) -> Result<&str, Error>
pub fn as_bytes(&self) -> Result<&[u8], Error>
pub fn into_bytes(self) -> Result<Vec<u8>, Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PgValue
impl RefUnwindSafe for PgValue
impl Send for PgValue
impl Sync for PgValue
impl Unpin for PgValue
impl UnsafeUnpin for PgValue
impl UnwindSafe for PgValue
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,
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