pub struct TimeDateTimeWithTimeZone { /* private fields */ }
Expand description
A PrimitiveDateTime
with a UtcOffset
.
All comparisons are performed using the UTC time.
Implementations
sourceimpl OffsetDateTime
impl OffsetDateTime
sourcepub fn now() -> OffsetDateTime
👎 Deprecated since 0.2.11: This function returns a value with an offset of UTC, which is not apparent from its name alone. You should use OffsetDateTime::now_utc()
instead.
pub fn now() -> OffsetDateTime
This function returns a value with an offset of UTC, which is not apparent from its name alone. You should use OffsetDateTime::now_utc()
instead.
Create a new OffsetDateTime
with the current date and time in UTC.
assert!(OffsetDateTime::now().year() >= 2019);
assert_eq!(OffsetDateTime::now().offset(), offset!(UTC));
sourcepub fn now_utc() -> OffsetDateTime
pub fn now_utc() -> OffsetDateTime
Create a new OffsetDateTime
with the current date and time in UTC.
assert!(OffsetDateTime::now_utc().year() >= 2019);
assert_eq!(OffsetDateTime::now_utc().offset(), offset!(UTC));
sourcepub fn now_local() -> OffsetDateTime
👎 Deprecated since 0.2.23: UTC is returned if the local offset cannot be determined
pub fn now_local() -> OffsetDateTime
UTC is returned if the local offset cannot be determined
Create a new OffsetDateTime
with the current date and time in the
local offset.
assert!(OffsetDateTime::now_local().year() >= 2019);
sourcepub fn try_now_local() -> Result<OffsetDateTime, IndeterminateOffset>
pub fn try_now_local() -> Result<OffsetDateTime, IndeterminateOffset>
Attempt to create a new OffsetDateTime
with the current date and time
in the local offset. If the offset cannot be determined, an error is
returned.
let now = OffsetDateTime::try_now_local();
assert!(now.is_ok());
sourcepub const fn to_offset(self, offset: UtcOffset) -> OffsetDateTime
pub const fn to_offset(self, offset: UtcOffset) -> OffsetDateTime
Convert the OffsetDateTime
from the current UtcOffset
to the
provided UtcOffset
.
assert_eq!(
date!(2000-01-01)
.midnight()
.assume_utc()
.to_offset(offset!(-1))
.year(),
1999,
);
// Let's see what time Sydney's new year's celebration is in New York
// and Los Angeles.
// Construct midnight on new year's in Sydney. This is equivalent to
// 13:00 UTC.
let sydney = date!(2000-01-01).midnight().assume_offset(offset!(+11));
let new_york = sydney.to_offset(offset!(-5));
let los_angeles = sydney.to_offset(offset!(-8));
assert_eq!(sydney.hour(), 0);
assert_eq!(new_york.hour(), 8);
assert_eq!(los_angeles.hour(), 5);
sourcepub const fn unix_epoch() -> OffsetDateTime
pub const fn unix_epoch() -> OffsetDateTime
Midnight, 1 January, 1970 (UTC).
assert_eq!(
OffsetDateTime::unix_epoch(),
date!(1970-01-01)
.midnight()
.assume_utc(),
);
sourcepub fn from_unix_timestamp(timestamp: i64) -> OffsetDateTime
pub fn from_unix_timestamp(timestamp: i64) -> OffsetDateTime
Create an OffsetDateTime
from the provided Unix timestamp.
assert_eq!(
OffsetDateTime::from_unix_timestamp(0),
OffsetDateTime::unix_epoch(),
);
assert_eq!(
OffsetDateTime::from_unix_timestamp(1_546_300_800),
date!(2019-01-01)
.midnight()
.assume_utc(),
);
If you have a timestamp-nanosecond pair, you can use something along the lines of the following:
let (timestamp, nanos) = (1, 500_000_000);
assert_eq!(
OffsetDateTime::from_unix_timestamp(timestamp) + Duration::nanoseconds(nanos),
OffsetDateTime::unix_epoch() + 1.5.seconds()
);
sourcepub fn from_unix_timestamp_nanos(timestamp: i128) -> OffsetDateTime
pub fn from_unix_timestamp_nanos(timestamp: i128) -> OffsetDateTime
Construct an OffsetDateTime
from the provided Unix timestamp (in
nanoseconds).
assert_eq!(
OffsetDateTime::from_unix_timestamp_nanos(0),
OffsetDateTime::unix_epoch(),
);
assert_eq!(
OffsetDateTime::from_unix_timestamp_nanos(1_546_300_800_000_000_000),
date!(2019-01-01)
.midnight()
.assume_utc(),
);
Note that the range of timestamps possible here is far larger than the valid range of dates storable in this crate. It is the user’s responsibility to ensure the timestamp provided as a parameter is valid. No behavior is guaranteed if this parameter would not result in a valid value.
sourcepub const fn offset(self) -> UtcOffset
pub const fn offset(self) -> UtcOffset
Get the UtcOffset
.
assert_eq!(
date!(2019-01-01)
.midnight()
.assume_utc()
.offset(),
offset!(UTC),
);
assert_eq!(
date!(2019-01-01)
.midnight()
.assume_offset(offset!(+1))
.offset(),
offset!(+1),
);
sourcepub fn unix_timestamp(self) -> i64
pub fn unix_timestamp(self) -> i64
Get the Unix timestamp.
assert_eq!(
date!(1970-01-01)
.midnight()
.assume_utc()
.unix_timestamp(),
0,
);
assert_eq!(
date!(1970-01-01)
.midnight()
.assume_utc()
.to_offset(offset!(-1))
.unix_timestamp(),
0,
);
sourcepub fn timestamp(self) -> i64
👎 Deprecated since 0.2.23: Use OffsetDateTime::unix_timestamp
instead
pub fn timestamp(self) -> i64
Use OffsetDateTime::unix_timestamp
instead
Get the Unix timestamp.
assert_eq!(
date!(1970-01-01)
.midnight()
.assume_utc()
.timestamp(),
0,
);
assert_eq!(
date!(1970-01-01)
.midnight()
.assume_utc()
.to_offset(offset!(-1))
.timestamp(),
0,
);
sourcepub fn unix_timestamp_nanos(self) -> i128
pub fn unix_timestamp_nanos(self) -> i128
Get the Unix timestamp in nanoseconds.
use time::{date, offset, time};
assert_eq!(
date!(1970-01-01)
.midnight()
.assume_utc()
.unix_timestamp_nanos(),
0,
);
assert_eq!(
date!(1970-01-01)
.with_time(time!(1:00))
.assume_utc()
.to_offset(offset!(-1))
.unix_timestamp_nanos(),
3_600_000_000_000,
);
sourcepub fn timestamp_nanos(self) -> i128
👎 Deprecated since 0.2.23: Use OffsetDateTime::unix_timestamp_nanos
instead
pub fn timestamp_nanos(self) -> i128
Use OffsetDateTime::unix_timestamp_nanos
instead
Get the Unix timestamp in nanoseconds.
use time::{date, offset, time};
assert_eq!(
date!(1970-01-01)
.midnight()
.assume_utc()
.unix_timestamp_nanos(),
0,
);
assert_eq!(
date!(1970-01-01)
.with_time(time!(1:00))
.assume_utc()
.to_offset(offset!(-1))
.unix_timestamp_nanos(),
3_600_000_000_000,
);
sourcepub fn date(self) -> Date
pub fn date(self) -> Date
Get the Date
in the stored offset.
assert_eq!(
date!(2019-01-01)
.midnight()
.assume_utc()
.date(),
date!(2019-01-01),
);
assert_eq!(
date!(2019-01-01)
.midnight()
.assume_utc()
.to_offset(offset!(-1))
.date(),
date!(2018-12-31),
);
sourcepub fn time(self) -> Time
pub fn time(self) -> Time
Get the Time
in the stored offset.
assert_eq!(
date!(2019-01-01)
.midnight()
.assume_utc()
.time(),
time!(0:00)
);
assert_eq!(
date!(2019-01-01)
.midnight()
.assume_utc()
.to_offset(offset!(-1))
.time(),
time!(23:00)
);
sourcepub fn year(self) -> i32
pub fn year(self) -> i32
Get the year of the date in the stored offset.
assert_eq!(
date!(2019-01-01)
.midnight()
.assume_utc()
.year(),
2019,
);
assert_eq!(
date!(2019-12-31)
.with_time(time!(23:00))
.assume_utc()
.to_offset(offset!(+1))
.year(),
2020,
);
assert_eq!(
date!(2020-01-01)
.midnight()
.assume_utc()
.year(),
2020,
);
sourcepub fn month(self) -> u8
pub fn month(self) -> u8
Get the month of the date in the stored offset. If fetching both the
month and day, it is more efficient to use
OffsetDateTime::month_day
.
The returned value will always be in the range 1..=12
.
assert_eq!(
date!(2019-01-01)
.midnight()
.assume_utc()
.month(),
1,
);
assert_eq!(
date!(2019-12-31)
.with_time(time!(23:00))
.assume_utc()
.to_offset(offset!(+1))
.month(),
1,
);
sourcepub fn day(self) -> u8
pub fn day(self) -> u8
Get the day of the date in the stored offset. If fetching both the month
and day, it is more efficient to use OffsetDateTime::month_day
.
The returned value will always be in the range 1..=31
.
assert_eq!(
date!(2019-01-01)
.midnight()
.assume_utc()
.day(),
1,
);
assert_eq!(
date!(2019-12-31)
.with_time(time!(23:00))
.assume_utc()
.to_offset(offset!(+1))
.day(),
1,
);
sourcepub fn month_day(self) -> (u8, u8)
pub fn month_day(self) -> (u8, u8)
Get the month and day of the date in the stored offset.
The month component will always be in the range 1..=12
;
the day component in 1..=31
.
assert_eq!(
date!(2019-01-01)
.midnight()
.assume_utc()
.month_day(),
(1, 1),
);
assert_eq!(
date!(2019-12-31)
.with_time(time!(23:00))
.assume_utc()
.to_offset(offset!(+1))
.month_day(),
(1, 1),
);
sourcepub fn ordinal(self) -> u16
pub fn ordinal(self) -> u16
Get the day of the year of the date in the stored offset.
The returned value will always be in the range 1..=366
.
assert_eq!(
date!(2019-01-01)
.midnight()
.assume_utc()
.ordinal(),
1,
);
assert_eq!(
date!(2019-12-31)
.with_time(time!(23:00))
.assume_utc()
.to_offset(offset!(+1))
.ordinal(),
1,
);
sourcepub fn iso_year_week(self) -> (i32, u8)
pub fn iso_year_week(self) -> (i32, u8)
Get the ISO 8601 year and week number in the stored offset.
assert_eq!(
date!(2019-01-01)
.midnight()
.assume_utc()
.iso_year_week(),
(2019, 1),
);
assert_eq!(
date!(2019-10-04)
.midnight()
.assume_utc()
.iso_year_week(),
(2019, 40),
);
assert_eq!(
date!(2020-01-01)
.midnight()
.assume_utc()
.iso_year_week(),
(2020, 1),
);
assert_eq!(
date!(2020-12-31)
.midnight()
.assume_utc()
.iso_year_week(),
(2020, 53),
);
assert_eq!(
date!(2021-01-01)
.midnight()
.assume_utc()
.iso_year_week(),
(2020, 53),
);
sourcepub fn week(self) -> u8
pub fn week(self) -> u8
Get the ISO week number of the date in the stored offset.
The returned value will always be in the range 1..=53
.
assert_eq!(
date!(2019-01-01)
.midnight()
.assume_utc()
.week(),
1,
);
assert_eq!(
date!(2020-01-01)
.midnight()
.assume_utc()
.week(),
1,
);
assert_eq!(
date!(2020-12-31)
.midnight()
.assume_utc()
.week(),
53,
);
assert_eq!(
date!(2021-01-01)
.midnight()
.assume_utc()
.week(),
53,
);
sourcepub fn weekday(self) -> Weekday
pub fn weekday(self) -> Weekday
Get the weekday of the date in the stored offset.
This current uses Zeller’s congruence internally.
assert_eq!(
date!(2019-01-01)
.midnight()
.assume_utc()
.weekday(),
Tuesday,
);
assert_eq!(
date!(2019-02-01)
.midnight()
.assume_utc()
.weekday(),
Friday,
);
assert_eq!(
date!(2019-03-01)
.midnight()
.assume_utc()
.weekday(),
Friday,
);
sourcepub fn hour(self) -> u8
pub fn hour(self) -> u8
Get the clock hour in the stored offset.
The returned value will always be in the range 0..24
.
assert_eq!(
date!(2019-01-01)
.midnight()
.assume_utc()
.hour(),
0,
);
assert_eq!(
date!(2019-01-01)
.with_time(time!(23:59:59))
.assume_utc()
.to_offset(offset!(-2))
.hour(),
21,
);
sourcepub fn minute(self) -> u8
pub fn minute(self) -> u8
Get the minute within the hour in the stored offset.
The returned value will always be in the range 0..60
.
assert_eq!(
date!(2019-01-01)
.midnight()
.assume_utc()
.minute(),
0,
);
assert_eq!(
date!(2019-01-01)
.with_time(time!(23:59:59))
.assume_utc()
.to_offset(offset!(+0:30))
.minute(),
29,
);
sourcepub fn second(self) -> u8
pub fn second(self) -> u8
Get the second within the minute in the stored offset.
The returned value will always be in the range 0..60
.
assert_eq!(
date!(2019-01-01)
.midnight()
.assume_utc()
.second(),
0,
);
assert_eq!(
date!(2019-01-01)
.with_time(time!(23:59:59))
.assume_utc()
.to_offset(offset!(+0:00:30))
.second(),
29,
);
sourcepub fn millisecond(self) -> u16
pub fn millisecond(self) -> u16
Get the milliseconds within the second in the stored offset.
The returned value will always be in the range 0..1_000
.
assert_eq!(
date!(2019-01-01)
.midnight()
.assume_utc()
.millisecond(),
0,
);
assert_eq!(
date!(2019-01-01)
.with_time(time!(23:59:59.999))
.assume_utc()
.millisecond(),
999,
);
sourcepub fn microsecond(self) -> u32
pub fn microsecond(self) -> u32
Get the microseconds within the second in the stored offset.
The returned value will always be in the range 0..1_000_000
.
assert_eq!(
date!(2019-01-01)
.midnight()
.assume_utc()
.microsecond(),
0,
);
assert_eq!(
date!(2019-01-01)
.with_time(time!(23:59:59.999_999))
.assume_utc()
.microsecond(),
999_999,
);
sourcepub fn nanosecond(self) -> u32
pub fn nanosecond(self) -> u32
Get the nanoseconds within the second in the stored offset.
The returned value will always be in the range 0..1_000_000_000
.
assert_eq!(
date!(2019-01-01)
.midnight()
.assume_utc()
.nanosecond(),
0,
);
assert_eq!(
date!(2019-01-01)
.with_time(time!(23:59:59.999_999_999))
.assume_utc()
.nanosecond(),
999_999_999,
);
sourceimpl OffsetDateTime
impl OffsetDateTime
Methods that allow formatting the OffsetDateTime
.
sourcepub fn format(self, format: impl Into<Format>) -> String
pub fn format(self, format: impl Into<Format>) -> String
Format the OffsetDateTime
using the provided string.
assert_eq!(
date!(2019-01-02)
.midnight()
.assume_utc()
.format("%F %r %z"),
"2019-01-02 12:00:00 am +0000",
);
sourcepub fn lazy_format(self, format: impl Into<Format>) -> impl Display
pub fn lazy_format(self, format: impl Into<Format>) -> impl Display
Format the OffsetDateTime
using the provided string.
assert_eq!(
date!(2019-01-02)
.midnight()
.assume_utc()
.lazy_format("%F %r %z")
.to_string(),
"2019-01-02 12:00:00 am +0000",
);
sourcepub fn parse(
s: impl AsRef<str>,
format: impl Into<Format>
) -> Result<OffsetDateTime, Error>
pub fn parse(
s: impl AsRef<str>,
format: impl Into<Format>
) -> Result<OffsetDateTime, Error>
Attempt to parse an OffsetDateTime
using the provided string.
assert_eq!(
OffsetDateTime::parse("2019-01-02 00:00:00 +0000", "%F %T %z"),
Ok(date!(2019-01-02).midnight().assume_utc()),
);
assert_eq!(
OffsetDateTime::parse("2019-002 23:59:59 +0000", "%Y-%j %T %z"),
Ok(date!(2019-002).with_time(time!(23:59:59)).assume_utc()),
);
assert_eq!(
OffsetDateTime::parse("2019-W01-3 12:00:00 pm +0000", "%G-W%V-%u %r %z"),
Ok(date!(2019-W01-3).with_time(time!(12:00)).assume_utc()),
);
Trait Implementations
sourceimpl Add<Duration> for OffsetDateTime
impl Add<Duration> for OffsetDateTime
type Output = OffsetDateTime
type Output = OffsetDateTime
The resulting type after applying the +
operator.
sourceimpl Add<Duration> for OffsetDateTime
impl Add<Duration> for OffsetDateTime
type Output = OffsetDateTime
type Output = OffsetDateTime
The resulting type after applying the +
operator.
sourceimpl AddAssign<Duration> for OffsetDateTime
impl AddAssign<Duration> for OffsetDateTime
sourcefn add_assign(&mut self, duration: Duration)
fn add_assign(&mut self, duration: Duration)
Performs the +=
operation. Read more
sourceimpl AddAssign<Duration> for OffsetDateTime
impl AddAssign<Duration> for OffsetDateTime
sourcefn add_assign(&mut self, duration: Duration)
fn add_assign(&mut self, duration: Duration)
Performs the +=
operation. Read more
sourceimpl Clone for OffsetDateTime
impl Clone for OffsetDateTime
sourcefn clone(&self) -> OffsetDateTime
fn clone(&self) -> OffsetDateTime
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for OffsetDateTime
impl Debug for OffsetDateTime
impl<'r> Decode<'r, MySql> for OffsetDateTime
impl<'r> Decode<'r, MySql> for OffsetDateTime
impl<'r> Decode<'r, Postgres> for OffsetDateTime
impl<'r> Decode<'r, Postgres> for OffsetDateTime
sourceimpl Display for OffsetDateTime
impl Display for OffsetDateTime
impl<'_> Encode<'_, MySql> for OffsetDateTime
impl<'_> Encode<'_, MySql> for OffsetDateTime
fn encode_by_ref(&self, buf: &mut Vec<u8, Global>) -> IsNull
fn encode_by_ref(&self, buf: &mut Vec<u8, Global>) -> IsNull
Writes the value of self
into buf
without moving self
. Read more
fn encode(self, buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer) -> IsNull
fn encode(self, buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer) -> IsNull
Writes the value of self
into buf
in the expected format for the database.
fn produces(&self) -> Option<<DB as Database>::TypeInfo>
fn size_hint(&self) -> usize
impl<'_> Encode<'_, Postgres> for OffsetDateTime
impl<'_> Encode<'_, Postgres> for OffsetDateTime
fn encode_by_ref(&self, buf: &mut PgArgumentBuffer) -> IsNull
fn encode_by_ref(&self, buf: &mut PgArgumentBuffer) -> IsNull
Writes the value of self
into buf
without moving self
. Read more
fn size_hint(&self) -> usize
fn encode(self, buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer) -> IsNull
fn encode(self, buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer) -> IsNull
Writes the value of self
into buf
in the expected format for the database.
fn produces(&self) -> Option<<DB as Database>::TypeInfo>
sourceimpl From<OffsetDateTime> for Value
impl From<OffsetDateTime> for Value
sourcefn from(v: OffsetDateTime) -> Value
fn from(v: OffsetDateTime) -> Value
Converts to this type from the input type.
sourceimpl From<SystemTime> for OffsetDateTime
impl From<SystemTime> for OffsetDateTime
sourcefn from(system_time: SystemTime) -> OffsetDateTime
fn from(system_time: SystemTime) -> OffsetDateTime
Converts to this type from the input type.
sourceimpl Hash for OffsetDateTime
impl Hash for OffsetDateTime
sourceimpl Ord for OffsetDateTime
impl Ord for OffsetDateTime
sourceimpl PartialEq<OffsetDateTime> for OffsetDateTime
impl PartialEq<OffsetDateTime> for OffsetDateTime
sourceimpl PartialEq<SystemTime> for OffsetDateTime
impl PartialEq<SystemTime> for OffsetDateTime
sourceimpl PartialOrd<OffsetDateTime> for OffsetDateTime
impl PartialOrd<OffsetDateTime> for OffsetDateTime
sourcefn partial_cmp(&self, rhs: &OffsetDateTime) -> Option<Ordering>
fn partial_cmp(&self, rhs: &OffsetDateTime) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl PartialOrd<SystemTime> for OffsetDateTime
impl PartialOrd<SystemTime> for OffsetDateTime
sourcefn partial_cmp(&self, other: &SystemTime) -> Option<Ordering>
fn partial_cmp(&self, other: &SystemTime) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl PgHasArrayType for OffsetDateTime
impl PgHasArrayType for OffsetDateTime
fn array_type_info() -> PgTypeInfo
fn array_compatible(ty: &PgTypeInfo) -> bool
sourceimpl Sub<Duration> for OffsetDateTime
impl Sub<Duration> for OffsetDateTime
type Output = OffsetDateTime
type Output = OffsetDateTime
The resulting type after applying the -
operator.
sourceimpl Sub<Duration> for OffsetDateTime
impl Sub<Duration> for OffsetDateTime
type Output = OffsetDateTime
type Output = OffsetDateTime
The resulting type after applying the -
operator.
sourceimpl Sub<OffsetDateTime> for OffsetDateTime
impl Sub<OffsetDateTime> for OffsetDateTime
sourcefn sub(
self,
rhs: OffsetDateTime
) -> <OffsetDateTime as Sub<OffsetDateTime>>::Output
fn sub(
self,
rhs: OffsetDateTime
) -> <OffsetDateTime as Sub<OffsetDateTime>>::Output
Performs the -
operation. Read more
sourceimpl Sub<SystemTime> for OffsetDateTime
impl Sub<SystemTime> for OffsetDateTime
sourcefn sub(self, rhs: SystemTime) -> <OffsetDateTime as Sub<SystemTime>>::Output
fn sub(self, rhs: SystemTime) -> <OffsetDateTime as Sub<SystemTime>>::Output
Performs the -
operation. Read more
sourceimpl SubAssign<Duration> for OffsetDateTime
impl SubAssign<Duration> for OffsetDateTime
sourcefn sub_assign(&mut self, duration: Duration)
fn sub_assign(&mut self, duration: Duration)
Performs the -=
operation. Read more
sourceimpl SubAssign<Duration> for OffsetDateTime
impl SubAssign<Duration> for OffsetDateTime
sourcefn sub_assign(&mut self, duration: Duration)
fn sub_assign(&mut self, duration: Duration)
Performs the -=
operation. Read more
sourceimpl TryGetable for OffsetDateTime
impl TryGetable for OffsetDateTime
sourcefn try_get(res: &QueryResult, pre: &str, col: &str) -> Result<Self, TryGetError>
fn try_get(res: &QueryResult, pre: &str, col: &str) -> Result<Self, TryGetError>
Ensure the type implements this method
impl Type<MySql> for OffsetDateTime
impl Type<MySql> for OffsetDateTime
fn compatible(ty: &MySqlTypeInfo) -> bool
fn compatible(ty: &MySqlTypeInfo) -> bool
Determines if this Rust type is compatible with the given SQL type. Read more
impl Type<Postgres> for OffsetDateTime
impl Type<Postgres> for OffsetDateTime
fn compatible(ty: &<DB as Database>::TypeInfo) -> bool
fn compatible(ty: &<DB as Database>::TypeInfo) -> bool
Determines if this Rust type is compatible with the given SQL type. Read more
sourceimpl ValueType for OffsetDateTime
impl ValueType for OffsetDateTime
fn try_from(v: Value) -> Result<OffsetDateTime, ValueTypeErr>
fn type_name() -> String
fn column_type() -> ColumnType
fn unwrap(v: Value) -> Self
impl Copy for OffsetDateTime
impl Eq for OffsetDateTime
impl StructuralEq for OffsetDateTime
Auto Trait Implementations
impl RefUnwindSafe for OffsetDateTime
impl Send for OffsetDateTime
impl Sync for OffsetDateTime
impl Unpin for OffsetDateTime
impl UnwindSafe for OffsetDateTime
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<V> FromValueTuple for V where
V: Into<Value> + ValueType,
impl<V> FromValueTuple for V where
V: Into<Value> + ValueType,
fn from_value_tuple<I>(i: I) -> V where
I: IntoValueTuple,
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<V> IntoValueTuple for V where
V: Into<Value>,
impl<V> IntoValueTuple for V where
V: Into<Value>,
fn into_value_tuple(self) -> ValueTuple
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more