pub struct OffsetTimestamp { /* private fields */ }Expand description
A timestamp with timezone offset.
Internally stored as UTC timestamp; the offset is for display purposes.
Implementations§
Source§impl OffsetTimestamp
impl OffsetTimestamp
Sourcepub const fn new(timestamp: Timestamp, offset_minutes: i16) -> OffsetTimestamp
pub const fn new(timestamp: Timestamp, offset_minutes: i16) -> OffsetTimestamp
Creates an OffsetTimestamp from a timestamp and UTC offset in minutes.
Sourcepub fn from_utc(
utc_timestamp: Timestamp,
offset_minutes: i16,
) -> OffsetTimestamp
pub fn from_utc( utc_timestamp: Timestamp, offset_minutes: i16, ) -> OffsetTimestamp
Creates an OffsetTimestamp from UTC timestamp and converts to specified offset.
Sourcepub const fn offset_minutes(&self) -> i16
pub const fn offset_minutes(&self) -> i16
Returns the UTC offset in minutes.
Sourcepub fn local_timestamp(&self) -> Timestamp
pub fn local_timestamp(&self) -> Timestamp
Returns the local timestamp (adjusted for offset).
Sourcepub const fn decode(encoded: u64) -> OffsetTimestamp
pub const fn decode(encoded: u64) -> OffsetTimestamp
Creates from a raw encoded value (assumes UTC, zero offset).
Sourcepub const fn to_microseconds_utc(&self) -> i64
pub const fn to_microseconds_utc(&self) -> i64
Returns UTC microseconds (Julian-based) for binary insertion.
Hyper stores timestamps as Julian-based microseconds.
Trait Implementations§
Source§impl Clone for OffsetTimestamp
impl Clone for OffsetTimestamp
Source§fn clone(&self) -> OffsetTimestamp
fn clone(&self) -> OffsetTimestamp
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 moreSource§impl Debug for OffsetTimestamp
impl Debug for OffsetTimestamp
Source§impl Display for OffsetTimestamp
impl Display for OffsetTimestamp
Source§impl From<DateTime<FixedOffset>> for OffsetTimestamp
impl From<DateTime<FixedOffset>> for OffsetTimestamp
Source§fn from(dt: DateTime<FixedOffset>) -> OffsetTimestamp
fn from(dt: DateTime<FixedOffset>) -> OffsetTimestamp
Converts to this type from the input type.
Source§impl FromBinaryValue for OffsetTimestamp
impl FromBinaryValue for OffsetTimestamp
Source§fn from_stream_row(row: &StreamRow, idx: usize) -> Option<OffsetTimestamp>
fn from_stream_row(row: &StreamRow, idx: usize) -> Option<OffsetTimestamp>
Extracts a value from a
StreamRow at the given column index.Source§fn from_batch_row(row: &BatchRow, idx: usize) -> Option<OffsetTimestamp>
fn from_batch_row(row: &BatchRow, idx: usize) -> Option<OffsetTimestamp>
Extracts a value from a
BatchRow at the given column index.Source§impl FromHyperBinary for OffsetTimestamp
impl FromHyperBinary for OffsetTimestamp
Source§impl Hash for OffsetTimestamp
impl Hash for OffsetTimestamp
Source§impl IntoValue for &OffsetTimestamp
impl IntoValue for &OffsetTimestamp
Source§impl IntoValue for OffsetTimestamp
impl IntoValue for OffsetTimestamp
Source§impl PartialEq for OffsetTimestamp
impl PartialEq for OffsetTimestamp
Source§fn eq(&self, other: &OffsetTimestamp) -> bool
fn eq(&self, other: &OffsetTimestamp) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl RowValue for OffsetTimestamp
impl RowValue for OffsetTimestamp
Source§impl ToHyperBinary for OffsetTimestamp
impl ToHyperBinary for OffsetTimestamp
Source§fn to_hyper_binary(
&self,
buf: &mut BytesMut,
) -> Result<(), Box<dyn Error + Sync + Send>>
fn to_hyper_binary( &self, buf: &mut BytesMut, ) -> Result<(), Box<dyn Error + Sync + Send>>
Serializes the value to HyperBinary format for a nullable column. Read more
Source§fn to_hyper_binary_not_null(
&self,
buf: &mut BytesMut,
) -> Result<(), Box<dyn Error + Sync + Send>>
fn to_hyper_binary_not_null( &self, buf: &mut BytesMut, ) -> Result<(), Box<dyn Error + Sync + Send>>
Serializes the value to HyperBinary format for a NOT NULL column. Read more
Source§fn hyper_binary_size(&self) -> usize
fn hyper_binary_size(&self) -> usize
Returns the size in bytes this value will occupy when serialized (nullable).
Source§fn hyper_binary_size_not_null(&self) -> usize
fn hyper_binary_size_not_null(&self) -> usize
Returns the size in bytes this value will occupy when serialized (not nullable).
Source§impl ToSqlParam for OffsetTimestamp
impl ToSqlParam for OffsetTimestamp
impl Copy for OffsetTimestamp
impl Eq for OffsetTimestamp
impl StructuralPartialEq for OffsetTimestamp
Auto Trait Implementations§
impl Freeze for OffsetTimestamp
impl RefUnwindSafe for OffsetTimestamp
impl Send for OffsetTimestamp
impl Sync for OffsetTimestamp
impl Unpin for OffsetTimestamp
impl UnsafeUnpin for OffsetTimestamp
impl UnwindSafe for OffsetTimestamp
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request