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<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<'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 Encode<'_, Postgres> for PgTimeTz<NaiveTime, FixedOffset>
impl Encode<'_, Postgres> for PgTimeTz<NaiveTime, FixedOffset>
source§fn encode_by_ref(&self, buf: &mut PgArgumentBuffer) -> IsNull
fn encode_by_ref(&self, buf: &mut PgArgumentBuffer) -> IsNull
fn size_hint(&self) -> usize
source§fn encode(self, buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer) -> IsNullwhere
Self: Sized,
fn encode(self, buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer) -> IsNullwhere Self: Sized,
Writes the value of
self
into buf
in the expected format for the database.fn produces(&self) -> Option<DB::TypeInfo>
source§impl Encode<'_, Postgres> for PgTimeTz<Time, UtcOffset>
impl Encode<'_, Postgres> for PgTimeTz<Time, UtcOffset>
source§fn encode_by_ref(&self, buf: &mut PgArgumentBuffer) -> IsNull
fn encode_by_ref(&self, buf: &mut PgArgumentBuffer) -> IsNull
fn size_hint(&self) -> usize
source§fn encode(self, buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer) -> IsNullwhere
Self: Sized,
fn encode(self, buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer) -> IsNullwhere Self: Sized,
Writes the value of
self
into buf
in the expected format for the database.