pub struct PgTimeTz<Time = Time, Offset = UtcOffset> {
pub time: Time,
pub offset: Offset,
}
Expand description
Represents a moment of time, in a specified timezone.
§Warning
PgTimeTz
provides TIMETZ
and is supported only for reading from legacy databases.
PostgreSQL recommends to use TIMESTAMPTZ
instead.
Fields§
§time: Time
§offset: Offset
Trait Implementations§
source§impl<'r> Decode<'r, Postgres> for PgTimeTz<Time, UtcOffset>
impl<'r> Decode<'r, Postgres> for PgTimeTz<Time, UtcOffset>
source§fn decode(value: PgValueRef<'r>) -> Result<Self, BoxDynError>
fn decode(value: PgValueRef<'r>) -> Result<Self, BoxDynError>
Decode a new value of this type using a raw value from the database.
source§impl<'r> Decode<'r, Postgres> for PgTimeTz<NaiveTime, FixedOffset>
impl<'r> Decode<'r, Postgres> for PgTimeTz<NaiveTime, FixedOffset>
source§fn decode(value: PgValueRef<'r>) -> Result<Self, BoxDynError>
fn decode(value: PgValueRef<'r>) -> Result<Self, BoxDynError>
Decode a new value of this type using a raw value from the database.
source§impl Encode<'_, Postgres> for PgTimeTz<Time, UtcOffset>
impl Encode<'_, Postgres> for PgTimeTz<Time, UtcOffset>
source§fn encode_by_ref(
&self,
buf: &mut PgArgumentBuffer,
) -> Result<IsNull, BoxDynError>
fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, BoxDynError>
fn size_hint(&self) -> usize
source§fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>where
Self: Sized,
fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>where
Self: Sized,
Writes the value of
self
into buf
in the expected format for the database.fn produces(&self) -> Option<<DB as Database>::TypeInfo>
source§impl Encode<'_, Postgres> for PgTimeTz<NaiveTime, FixedOffset>
impl Encode<'_, Postgres> for PgTimeTz<NaiveTime, FixedOffset>
source§fn encode_by_ref(
&self,
buf: &mut PgArgumentBuffer,
) -> Result<IsNull, BoxDynError>
fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, BoxDynError>
fn size_hint(&self) -> usize
source§fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>where
Self: Sized,
fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>where
Self: Sized,
Writes the value of
self
into buf
in the expected format for the database.fn produces(&self) -> Option<<DB as Database>::TypeInfo>
source§impl<Time, Offset> PgHasArrayType for PgTimeTz<Time, Offset>
impl<Time, Offset> PgHasArrayType for PgTimeTz<Time, Offset>
fn array_type_info() -> PgTypeInfo
fn array_compatible(ty: &PgTypeInfo) -> bool
impl<Time: Copy, Offset: Copy> Copy for PgTimeTz<Time, Offset>
impl<Time, Offset> StructuralPartialEq for PgTimeTz<Time, Offset>
Auto Trait Implementations§
impl<Time, Offset> Freeze for PgTimeTz<Time, Offset>
impl<Time, Offset> RefUnwindSafe for PgTimeTz<Time, Offset>where
Time: RefUnwindSafe,
Offset: RefUnwindSafe,
impl<Time, Offset> Send for PgTimeTz<Time, Offset>
impl<Time, Offset> Sync for PgTimeTz<Time, Offset>
impl<Time, Offset> Unpin for PgTimeTz<Time, Offset>
impl<Time, Offset> UnwindSafe for PgTimeTz<Time, Offset>where
Time: UnwindSafe,
Offset: UnwindSafe,
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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